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.