In high school, my sociology teacher introduced us to the term “ethnocentrism”, defined as the near-universal tendency among people to favour those who share similar traits such as race, culture, and nationality. It is neither good nor bad; it just is.
“Ethnocentrism” is merely a fifty-cent word for “tribalism.” People survive by hanging with those they can trust and who can trust them. Been that way since the beginning.