On the neurological side, because it has proven to be a useful survival strategy, the human brain is constantly trying to make sense of the world. God is a convenient and simple explanation for all and everything and probably a side-effect of the sense-making attempts when other explanations are difficult to come by.
On the psychological side, religions address our fear of death and tell us that life is fair after all, the bad guys will be punished - post mortem. They help us to find meaning in the carelessness of the cosmos.
On the social side, small children are likely to believe what elders tell them; indoctrination at young age is highly efficient and hard to overcome later. We all want to fit in.
I learned an interesting new aspect at the latest FQXi meeting from David Eagleman, though he didn't draw a connection to religious thinking. Most mentally healthy people lead internal monologues. It's an input-output cycle that circumvents the external part of the loop (in which you actually speak and hear your voice). Eagleman spoke about his hypothesis according to which a failure of the brain to correctly time the inner monologue would have you think you "heard" your inner voice before you formulated it yourself, creating the illusion that you are hearing voices.
Evidence for the neurological roots of religious believes is mounting, see eg Kapogiannis, D., et al. "Cognitive and neural foundations of religious belief" or this earlier post. Or, if that's too many words, here's a fluff talk about funny things people believe by Michael Shermer
So, I'm with Dawkins on the origin of religious beliefs.
On the other hand I think religions serve a need of our societies, and the big churches have learned to serve it well. They provide a community for their followers, no entry exam required, and they offer help and advice. They have beautiful architecture and music. This used to be my favorite church song:
It's a variant of Gloria in excelsis deo. So what, really, does science have to offer in comparison?
I think that the biggest problem that science in the 21st century faces is to convince religious people that it has something to offer to them; that scientific thinking brings a value added to their life. Unfortunately, scientists, me included, are not good in sharing this value. Most of us, that is. Carl Sagan did a pretty good job. Neil deGrasse Tyson does too.
When the piano music set in, I felt like puking, and I hate Symphony of Science with a passion. But Tyson's speech has been viewed more than 2 million times, and Symphony of Science is wildly popular, so clearly it speaks to people. And the reason is simple: They're awe-inspiring.
These are both brilliant examples that document so nicely what science can do for you: It tells you what is your place in the universe. It explains how the universe works and how you're part of its working. That's more than any monotheistic religions can offer. In fact, the whole purpose of these religions is to get you to stop asking, to stop thinking.
Shawn Otto has written a book about the US American right's war on science, called "Fool Me Twice: Fighting the Assault on Science in America." I haven't read the book and have no intention to but there's an interesting interview with Otto on Daily Kos. Otto makes a case there that
"When one side of the debate is based on knowledge and the other is based on mere belief or opinion, it’s really a battle over freedom versus authoritarianism...
I understand the argument he's trying to lead, but I think it's not going to be successful. This isn't a battle about freedom, it's a battle about happiness. For Otto's argument to work, he'd have to show that a science-based democracy will contribute the most to the societies' well-being. Now, I believe this is indeed the case, but the problem is that Otto can't base his argument on beliefs, otherwise it'll turn upside down. And to my best knowledge there's no scientific proof that democracy and science make people more happy than, say, monarchy and religion. So, in the end we're left with opinions which is why I doubt this will lead anywhere, especially since the "anti-scientific" side isn't burdened by sticking to scientific arguments.
Thus, I think the awe-inspiring approach is much more promising. Chances are, in the course of time, scientific-themed music will become more common (and less sickening). Bjök's Biophilia is maybe a beginning - though that's arguably not everybody's petridish. What science is still lacking though is a broad sense of community that includes the non-professional public. If I had an institute, I'd have a weekly public event, every Sunday morning at 11, open for everybody. We'd summarize this weeks awesome news, see the most amazing images and videos, and talk about a topic that gives everyone something to think about. On occasion, we'd have a guest speaker. After that, we'd all have a brunch and people could stay and talk and make suggestions for the next week.
I think we have a long way to go to convince people that science is more than a collection of numbers and figures, but a way to understand the world and our place in it. But we're well on the way.