Definitely. Religion provides answers to the way the world works (not accurate ones but science is a concept that takes a while to develop and no one wants to wait for answers.) It provides a moral code to live by and it provides something to believe in and give people hope when there is none.
There is nothing else in existence that provides all of those things. Science provides answers, philosophy and law provide a moral code and without religion people are left to find hope on their own (which is the reason religion is still around).
oh and religion also provides some very interesting stories to tell long after people stop believing them (unfortunately religion hasn't quite figured out good music yet. )
The moral code part I don't agree with, since humans don't need anyone to tell them what's good or bad - that knowledge comes from higher brain function.
But yeah, the rest I can definitely agree on.