I see that the third most popular NY Times article this morning is a review of Richard Dawkins' book The God Delusion, in which he proves that God doesn't exist.
Dawkins says that religion is a meme that gets passed on from parent to children by taking advantage of the fact that children are biologically wired to be gullible and believe what their parents tell them. He says that religion offers no advantages at all to it's host.
I think this is a little oversimplistic, because adults do suddently find religion or change their beliefs. People have all kinds of weird superstitious beliefs that didn't come from their parents. The desire to believe in dumb stuff must be hardwired into our brains, so it must have at one time provided a survival advantage. In fact, the survival advantage still seems to be intact, because I have pointed out before that religious people have more children than non-religious.