I'm assuming that "compartmentalizing" is interchangeable with in-group bias?
I think all three have a negative impact on society, however I also think that all three can be overcome with education and practice.
In-group bias can be overcome by changing the parameters of the "group" (hard to exclude a demographic as "other" if you consider "all humans" to be part of your tribe). Confirmation bias can be overcome with skepticism and critical thinking (this is more of a habit than a silver bullet solution). Cognitive dissonance can be over come if you train yourself to recognize it and account for it in your decision making (again, a habit thing).
That's the good news. The bad news is that none of this is taught regularly. In-group bias is typically only discussed in sociological circles. Confirmation bias is typically only discussed in scientific circles. Cognitive dissonance is typically only discussed in psychological circles. Not many people have that resume.