I find your point about this being a remnant of ancient tribalism and pack behavior resonates with me the most. That idea strikes me as most likely to be valid since ingroup/outgroup associations were so critical to...hmm, no...so required for our ancestors to survive and thrive.
It goes back well before humans, before apes, primates, and even before mammals. It's extraordinarily common across the entire animal kingdom, the members of which must be at every moment ready to rapidly classify encounters with the world into kin or not-kin, safe or dangerous, prey or predator.
I'd even argue (and have argued in the past) that it goes all the way back to single-celled organisms. Those that reproduced most successfully tended to be better at differentiating between ouch and not-ouch or food and not-food.
Taken to its logical end, this same ability to discriminate and group items happens even at the level of molecules, atoms, and quarks; each of which are best described using the language of chemistry and physics; a language that could also potentially be used to describe the groupings and behaviors of us mostly hairless apes that you've raised in the OP.
In case it's not already abundantly clear, I think you're spot on about this phenomenon being deeply tied to the copious rewards afforded to those who engaged in tribal behavior across our evolutionary past.
Returning to human populations and our modern age, however, I'd like to introduce the psychological concept of insecurity as another possible explanation.
If you are insecure, it's possible you are more sensitive and averse to the risk of a possible ostrasization from the larger group, largely since membership in that group brings with it by default added security, access to resources, simplified personal prosperity and easier paths to survival. All of these things would be comforting to an insecure person.
Now, I admit that I'm not sure if these ingroup behaviors and willful blindness / easy dismissal of horrible deeds committed by kin are themselves driven in reality by psychological insecurity, but it'd sure be interesting to explore and test.
I wonder too if this idea is crap. I can normally convey my thoughts more concisely, so that makes me feel insecure about it.