Pascal Boyer in Nature on religion:
One important finding is that people are only aware of some of their religious beliefs. … For instance, experiments reveal that most people entertain highly anthropomorphic expectations about gods, whatever their explicit beliefs. … Research has shown that unlike conscious beliefs, which differ widely from one tradition to another, tacit assumptions are extremely similar in different cultures and religions. … Experiments suggest that people best remember stories that include a combination of counterintuitive physical feats … and plausibly human psychological features. … Experiments show that it is much more natural to think "the gods know that I stole this money" than "the gods know that I had porridge for breakfast." …
Humans are unique among animals in maintaining large, stable coalitions of unrelated individuals, strongly bonded by mutual trust. Humans evolved the cognitive tools to … gauge others’ reliability. … They can emit and detect costly, hard-to-fake signals of commitment. … When people proclaim their adherence to a particular faith, they subscribe to claims for which there is no evidence, and that would be taken as obviously wrong or ridiculous in other religions groups. This signals a willingness to embrace the group’s particular norm for no other reason than that it is, precisely, the group’s norm.
We feel a deep pleasure from realizing that we believe something in common with our friends, and different from most people. We feel an even deeper pleasure letting everyone know of this fact. This feeling is EVIL. Learn to see it in yourself, and then learn to be horrified by how thoroughly it can poison your mind. Yes evidence may at times force you to disagree with a majority, and your friends may have correlated exposure to that evidence, but take no pleasure when you and your associates disagree with others; that is the road to rationality ruin.
Added 6Nov: I didn’t mean to emphasize the size of the group you agree with. The emotion is mainly tied to believing the same as an in-group, relative to an out-group.