(Herein, by ‘religion’ I mean organized, Judeo-Christian-Islamic religion.)
Religion makes the pious feel good about themselves and life, achieving its effect by assuring them that they are loved, and that things will turn out all right in the end, by answering for them many troubling questions, and by encouraging them to behave in ways (being nice, generous, avoiding addictive substances, etc) that would probably make them feel good even if they did them without prodding.
Religion makes a society more cohesive, if everyone in it is the same religion. It takes over some of the socialist duties of government (such as providing charity, care for the poor, emergency relief, etcetera), allowing the faithful to be politically republican (not evil socialist!) without the entire society falling apart.
Religion also sets those who are members of it in opposition to those who are not. In its weakest form this merely implies the faintest sense of ‘too bad for Joe, he’s going to hell, maybe I should think about talking him over to my side sometime’, and in the strongest form there is no atrocity too harsh to be committed in the name of God against them. Even at moderate levels the faithful are compelled to persuade or force others to comply with the ideals of the pious, often with little or no regard for the rights or preferences of the unpious. In the extreme cases, the pious go along with these crimes against humanity as a direct result of their religion.
Religion also tends to make people more likely to accept authority, even when the voice of authority is not a morally sound one (like, say, a bigot, looney, warmonger, or tyrant). There also seems to be a historical risk of the non-pious gaining the support of the pious through mere rhetoric, and then forcing their agenda through regardless. The adversarial nature of religion with regard to non-members makes this an easy route for those who are willing to couch their desires within the religious agenda (or lie about what they are doing).
So, religion is a balm for the individual, a cohesive element, a divisive element, a force of oppression, and a tool of tyrants. In short, its a great thing until the minute something goes wrong.