People aren’t usually bad at logic. They’re protecting something logic can’t touch.

When a piece of evidence threatens to put someone at odds with the group they belong to, the evidence tends to lose. Research on identity-protective cognition finds that people — including people who otherwise score well on measures of reasoning ability — selectively credit or dismiss information in whatever pattern best preserves their standing with a group whose beliefs matter to them, and that this effect gets stronger, not weaker, among people with more capacity for sophisticated reasoning, since they’re better equipped to rationalise the conclusion they already needed.

This is a large part of why simply supplying someone with correct information so often fails to change what they believe: the obstacle usually isn’t a lack of facts, it’s that accepting the facts would cost something socially.

Source: Kahan, D.M. (2017). “Misconceptions, Misinformation, and the Logic of Identity-Protective Cognition.”