Primate Dave said,"religion will never die because it is a part of our social evolution."
I agree that it's part of our social evolution; so are a few other things that have died and some we hope won't die - like scientific reason and research and consciousness-raising.
God is the default concept for fear-relief and empowerment, and religion is its priory (as many here have already suggested in mentioning fear of death, the human need for comfort, socializing, etc.).
I was just reading this last night in The God Delusion (which is taking me a long time to get through because I'm reading 4 or 5 books alongside it and working full-time). Of the "Divine Knob-Twiddler" argument for God's existence, Richard Dawkins says:
"Maybe the psychological reason for this amazing blindness has something to do with the fact that many people have not had their consciousness raised, as biologists have, by natural selection and its power to tame improbability." (reference to the seeming improbability that the 6 constants of the universe (such as the strong force) evolved so that the evolution of life on earth eventually became possible).
Dawkins goes on to say that," J. Anderson Thomson, from his perspective as an evolutionary psychiatrist, points me to an additional reason, the psychological bias that we all have towards personifying inanimate objects as agents. As Thomson says, we are more inclined to mistake a shadow for a burglar than a burglar for a shadow. A false positive might be a waste of time. A false negative could be fatal. In a letter to me, he suggested that, in our ancestral past, our greatest challenge in our environment came from each other. 'The legacy of that is the default assumption, often fear, of human intention. We have a great deal of difficulty seeing anything other than human causation.' We naturally generalized that to divine intention. . ."
This is not the last word on why we developed religion and still cling to it, but I think it helps me to understand why people do cling so heartily to what seems ignorant and shallow to me. It is hard to understand how educated people still hang on to it. But life is difficult, challenging and daunting and religion does offer comfort in many ways, and is most especially comforting to us in denial, ignorance and fear.
Delusion, as someone mentioned above is a defense mechanism that is profoundly effective for survival in many situations. That's the easiest way for me to understand it. But it's still hard to comprehend how and why people cling so tightly to it, especially in a secular society.
I guess it's easier than research and questioning, too. After all, researchers and questioners meet with a great deal of persecution and rage from true believers. I certainly recognize that publicizing my own atheistic views in many situations might be akin to suicide because of that. Don't you?