Racism is pretty broad.
There's the innate kin-selective aspect , where one biological line selects for similar traits
Then there's the Cognitive side, which functions more like a protective trade-policy.
Racism is not without base/utility, it's just not good policy, as it does not fully utilize competitive advantage..
Because of how bad things got in the days (before) nuclear weapons, people thought they COULD WIN a global war.. So they utilized Racism as a background foreign policy.
They tried a bunch of times.. Eventually, the big weapons were invented, and world peace was achieved.