I think that the invention of god/religion had something to do with our origens as a species. Here we are weak, naked and vulnerable in a world where death comes easily to our kind. (we have such a top position today that many of us can't comprehend of a time where we had to be afraid of everything just to survive) Death came to us as predators like the cave lion and the wolf, it came to us as prey animals like the Archuos and the Mammoth, it came as an accident or a cold at the wrong time.
I think then that it was a way for us to deal with our situation and hopefully have some control over the uncontrolable. If we could ask spirits for help in a hunt or to drive off illness we at least felt like we were doing something to help ourselves in an helpless situation.
I think that it is key to remember that we are not the only creatures to have come up with a spirituality. Neanderthals also had this concept. They buried thier dead, and eaven left grave goods with them. They set up shrines with carefully placed collections of bones, mostly of cave bear skulls. They developed music and art.
Something happined to us (the hominid line) that opened our minds not only to new ideas in toolmaking but to cultural ideas as well.
but hey thats just my opinion.
wa:do (cherokee for thank you
)