I'm sure now that you're aware of these results, you'll update your beliefs accordingly - either that in-group favoritism is advantageous, or at the very least that we can't yet be sure getting rid of it is.
[1] The Evolutionary Dominance of Ethnocentric Cooperation: http://jasss.soc.surrey.ac.uk/16/3/7.html
[2] Evolution of in-group favoritism: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3380441/
[3] The Evolution of Ethnocentrism: http://www-personal.umich.edu/~axe/research/Hammond%20and%20... (journal version: https://journals.sagepub.com/doi/10.1177/0022002706293470) - key quote: "When cooperation is especially costly to individuals, the authors show how ethnocentrism itself can be necessary to sustain cooperation."