This kind of in-group, out-group dynamic seems like a default for humanity. It's pretty easy to lapse into xenophobia - since that's our default. Trying to widen the circle of the "in-group" status is hard, and goes against our instincts.
* ETA: Thinking back on this period, I recall our teacher trying her best to combat the bullying of one girl in particular. She would do things like sit us down as a class and explain to us why it was cruel, with the girl in her lap, and reading stories to us about bullying. None of it worked, I literally remember sitting there, nodding along, and being frankly too dumb to connect this back to my own bullying. In hindsight, the one thing that I think would have worked is if she had publically reprimanded us everytime she had caught us in the act. I think that kind of repeated, instant feedback would finally gotten through to us.