I'm currently reading a popular science book by this guy called "How the Mind Works" and it's proven to be one of the most fascinating science books I've ever read. In it, he attempts to reverse-engineer how the mind works using the principals of evolution. Not only is it a brilliant text for psychology (Most psychology books make me question the mental integrity of the author - read Freud anyone?), but it turned out to be the best explanation of natural selection I've come across. There are parts of it that are NOT mainstream scientific thought currently, but I recommend having a read nonetheless. The logic works…
Anyways, I found this on the net, titled "The Evolutionary Psychology of Religion".
He uses the same line of reasoning in this article as he uses in "How the Mind Works", attempting to explain why we have religion.