Earlier quoted context omitted.
What!? Religious rules are not "to protect the community from sociopaths." For example, eating pork is not sociopathic behavior and yet a large part of the world's religions forbid pork eating. People who have problems with the religious community usually are for their arbitrary rules rather than they'd much rather be sociopaths. (I'd make the argument they aren't particularly good about keeping sociopaths out anyway…
The parent commenter probably read this book: https://www.gitbook.com/book/hintjens/psychopathcode/details I read it to. The thesis is basically that - societal norms are designed to make it easy for normal people to notice psychopaths and avoid them. The book is pretty convincing, I'd give it a look. I didn't notice too many numbers or studies quoted in it, though. Presented without evidence though, parent commenter…
Not only has that sometimes caused harm to harmless people "not in the tribe", but sometimes legitimate sociopaths have actually exploited "the rules and norms" to their end. (A particularly notorious example of the later that I can think of is Ted Bundy.)
Agreed with the idea that religion does foster a sense of community. If you can get that without the nasty tribalism side effects you sometimes see from it, it would work.