It's no secret that I don't ascribe to any religious beliefs, but I think that religion gets unfairly panned by atheists. Before I talk about why religion can be good, I will enumerate specific religious beliefs that I think are harmful. I will refer to manifestations, rather than make blanket statements about religions, since it's usually certain groups that espouse the harmful beliefs. Many manifestations of western religion are obsessed with social dominance (it's a worthwhile read), which puts them at odds with anyone that has dissimilar beliefs. This is the root behind a lot of the hatred that is put forth by religious groups. Also, many manifestations are selfish interpretations of the religion. For example, some Christians interpret Genesis 1:26 to mean that people can do whatever they want to the earth without regards to the effects.
Those two are the most obvious problematic beliefs. They aren't necessarily isolated to religion, and are visible in the political arena. Within religions, these beliefs are most common within fundamentalist sects of Christianity and Islam. Buddhism seems to be the religion that does the best job of avoiding these.
The reason religion can be a good thing is because it gives people meaning, purpose, and moral guidance in a way that is accessible. Most people would be ideologically lost without religion, since trying do derive meaning, purpose, or morality from existence without it is far from easy. In fact, I think the rise of non-believers is largely due to the creation of viable non-religious world views. As a non-believer myself, I think that religion is valuable, but needs to be kept in check, in the sense that a belief system and its effects should only be applied to its practitioners.