It seems that racism/sexism/homophobia/etc/etc/etc are pervasive tendencies in society. I believe that if men hadn't come to dominate women, it would be women who had tried to dominate men. And if light-skinned people hadn't dominated others, someone of another ethnicity/race would have tried to dominate lighter-skinned people.
Caveat #1: Saying that bigotry seems to be a natural urge is not to excuse it. Some things are natural (eg. rape) but have nonetheless been deemed by modern society to be worth resisting.
Caveat #2: Evo-psych and just-so stories have long been problematic. Although this page dabbles in these, it merely lists untested hypothoses; it should not be interpreted as providing answers.
This page is written from the perspective that prejudice/bigotry are harmful to society, that countries would be stronger if they no longer discounted huge percentages of their productive workers. If you think that prejudice is actually beneficial from an evolutionary standpoint, then you probably won't be interested in this page.