I'm so jealous; this one guy had a Gastly level 19 and it knew Sucker Punch, which Gastly doesn't learn until level 22. What's up with that!?
Because that's the way the programmers made it. Often, they try to have one common move as the "TM" move that you can get to show you what it can do. They also have to accommodate the player with reasonably leveled pokemon so you aren't getting overpowered too early. You can program the pokemon to have whatever moves you want (they can even do illegal sets, but they choose not to.) So does it make sense that Gastly knows sucker punch at level 19? Not quite. Does it make sense that most of those trainers have really high leveled pokemon that past their evolution level, but are still in their basic form? Not so much either. You can only get so much logic from a children's game.