I once read a book that had similar thoughts.
The argument was that early on in our evolution humans were primarily right brained, and that was the main part that dealt with things like creativity and imagination.
The right brained human in times of stress would then hallucinate commands from respected and sometimes dead members of the tribe, giving them the idea of an after life.
It was a pretty interesting theory, not sure if it was accurate or how it might effect a more modernized brain though.