Religion is a means of forming social bonds and understanding our relationship to the universe and each other. There's nothing inherently bad about either of those things.
The problem comes when people start using it as a cudgel against others or an excuse for their shitty behavior.