The human mind seems to have some sort of built-in tribalism. Throughout history, humans have gravitated towards favoring the in-group and discriminating the out-group. The difference between those groups could be skin color, language, religion, family name or anything. Could be literally anything, no matter how trivial or silly. There have been some interesting studies about this.
See also: minimal group paradigm, in-group bias.