I've thought (and posted) a lot on this, so at the risk of repeating myself, I think religion serves 4 purposes
Posted on by ny1995
1. It gives people answers to unanswered or unanswerable questions. Uncertainty is taxing. We want to know. Why did this happen? What happens after death? Is there justice? This is the "spiritual" aspect of religion.
2. It gives people a guideline on how to be a good person. What actions are right and what actions are wrong? How should we treat each other? What is important in this world? This is the "moral" aspect of religion.
3. It gives the people in power a medium to control the population. You have to do this. You're not allowed to do that. You aren't allowed to eat this, and you have to wear that. This is the "political" aspect of religion.
And as a byproduct
4. It brings communities together to form a sense of togetherness, oneness and community spirit. This is the "community" aspect of religion.
The community aspect is fantastic, at least until or unless it becomes "us vs them". Forming a community = wonderful. Beneficial to society, beneficial to the members of the community. Seeing that in opposition to someone else's community is where it goes wrong.