Though I consider myself agnostic, I think that religion serves a very meaningful purpose to all societies on both an individual level, as well as in group organization- keeping in mind though, that I am not exactly including extreme cults and fundementalists.
I think that religion has always been a means for people to provide an answer for questions in which they cannot answer though means of science. Religious stories help calm fears of the afterlife, why people become ill, why the plants did not grow, and so on. It proivides comfort and hope to those who have no where else to find it, Sort of like an emotional "blankie".
On a larger level, religion can be used as a "rule maker", a way to keep the masses tame (think 10 commandments). Also, it is a way to instill togetherness, a feeling that everyone in the community belongs.
Though I think I sort of buttered up religion, there is plenty I find wrong, but I'm thinking on a more positive level here. I myself am agnostic for various reasons, but I do see how some people need it in their life, and I have no problem with people believing in what they do. Unless of course, it drives them to the edge of crazy....