Have you been following the debate over religion & science? Whether you have or not, if you're interested, you should definitely check out Darwin's God, an article in Sunday's New York Times magazine. Robin Marantz Henig summarizes the debate on both sides in clear prose that is not (imho) inflammatory.
The main question is: "are we hard-wired to believe in God? And if we are, how and why did that happen?"
In this corner, we have ... Byproduct Theorists, who argue that religion is a "spandrel", which Henig describes thusly:
"Stephen Jay Gould, the famed evolutionary biologist at Harvard who died in 2002, and his colleague Richard Lewontin proposed 'spandrel' to describe a trait that has no adaptive value of its own. They borrowed the term from architecture, where it originally referred to the V-shaped structure formed between two rounded arches. The structure is not there for any purpose; it is there because that is what happens when arches align." (see the wikipedia definition of spandrel.)
The spandrel could be a result of one or more of these three cognitive tools: agent detection, causal reasoning, and/or theory of mind.
Spandrelists (great name) do not necessarily agree that religion or belief in God "offered an adaptive advantage to our ancestors."
Adaptionists, in the other corner, think that "even if a trait offers no survival advantage today, it might have had one long ago."
David Sloan Wilson, evolutionary biologist at SUNY Binghamton, "staked out the adaptationist view. 'Through countless generations of variation and selection, [organisms] acquire properties that enable them to survive and reproduce in their environments. My purpose is to see if human groups in general, and religious groups in particular, qualify as organismic in this sense' " in his 2002 book Darwin's cathedral : evolution, religion, and the nature of society.
(side note: How does this relate to me? I'm going to see him speak this afternoon at Hampshire College.)
Henig's article is important reading if you are interested in this topic!