Where did the Megaton crater come from?
Solution 1:
The crater that the bomb left behind is not much larger than the bomb itself. If you look here, you'll see that the actual crater from the bomb is the greenish pool of water that sits directly above 'The Brass Lantern', written on the map. There is a slight upward slope immediately around that area as well, but nowhere near as severe as the crater itself.
Your confusion might have stemmed from the way the walls were built; but the walls were built around the bomb after it fell and failed to explode.
Solution 2:
If you ask around in Megaton, there is an old woman who will tell you that the crater was caused by a plane crash and that they used the crashed plane to build the town. It's my guess that the plane carried the bomb and it did not go off during the crash.