While religion can bring people comfort and benefits, I am not a big fan of it for myself mostly because I have not found a religion that is not a shame based system, and a shame based mindset is wildly unhealthy for me.
The particular combination that was my inherently analytical and focused mind + the shame based structure of some of the churches we were in when I was very young was an unhealthy combo for me. One of my first memories is of a Sunday night laying in bed after a long day that included a sermon at Church. The preacher was telling us that if you should, even for a moment, entertain the idea that god isn't real you would go to hell. And well, me being who I am, I couldn't not. So I laid there, terrified to do it, trying to avoid it, but I did, I, just for a moment, imagined that god wasn't real. And then I proceeded to have an anxiety attack worried that I would go to hell.
Also, a few years back while dealing with depression/anxiety, I did this journaling exercise program and discovered that even in my late 30's I still had religious guilt in the back of my head. So much of my subconscious mind was shame based. I realized that, but it's a hard thing to undo. And then one day an interesting thing happened. I was in the midst of a massive wave of depression in what I call a 'should loop' or 'shame spiral'. My head was filled with thinking that I was doing everything wrong and hyper focused on what I should be doing. I was walking though the kitchen with 'maybe I should..., maybe I should...' playing in my head like a broken record when I heard something. Hearing voices is interesting cuz I didn't really hear it with my ears, it was more like someone hijacked my internal dialogue, and all it said was "This experience is for you." Which was wildly interesting and so, so different from where my head was in that moment. What if, what if life isn't a test, what if it's actually an experience that is for us, to benefit us?
I now tell myself "this experience is for you" nearly every day. And this is my issue with religion, it views life as a punishment or a test, and not as a self directed benefit.