Answering the question of the topic; I think one possibility is that by observing the mammalian world it may be easy to deduct that every being comes from another being and that logically then, by extension, the first humans had to come from some great extraterrestrial being. And so the idea of god was born. Since there was logic behind it, and because it can't easily be disproved, then the fantasy persisted and spread to all regions of the world.
Also I believe that UFO sightings and sightings of aliens who had come down from above engendered the belief that "gods" lived up there. I think Judaism was the first religion to say there's only one god. All previous ones said there were various gods.