Join a religious organization to fight loneliness is like start smoking to loose weight.
Although, if you are doing politics, I can see this being pragmatically useful.
You're not solving loneliness by joining a cult or a gang. You can only deal with it by making authentic connections to people you actually want to be with. Countless of people are lonely and miserable within families.
Churches get brought up a lot because they regularly gather people (weekly or even daily) and offer events, volunteer opportunities, and so on.
The point is to find an activity you like, with a specific group of people and consistently attend.
P.S As a fellow Catholic, I’m really sorry you went through such an isolating experience. I hope things feel much better for you now