Well, I think a lot of it comes from people being afraid of a couple basic things in life:
1) The unknown (death, the future, et cetera)
2) The uncertain (will it rain enough to keep the crops going, will we all contract smallpox and die)
3) The unpleasant (no one loves me, no one will help me, I'm on my own)
...so, a god can handle all those things. The god has a plan, so there is no real uncertainty. The god knows all, so just because you don't know, doesn't mean there isn't someone covering it. The god, creator of everything, provides an afterlife, in which the good are rewarded and the wicked are punished.
On the face of it, that seems like a pretty appealing deal.
I can understand how people are susceptible to such nonsense as children, but to still accept it beyond the age of, say, 13, is shameful.