Ever Notice...
...that animals don't discriminate each other based on what color their fur is? Black cats like white cats just the same. I know, because two of them are screwing outside my window every night. So, why can't people be like that?
It's because someone a long time ago decided that differences in others make them inferior. And then they got their friends to agree to that. And then they taught their kids that. And, like you showed, the folks being hated upon decided to hate back.
It could be argued that we are the most intellectually and socially advanced creatures on the face of the earth. And yet we judge someone by skin color. (Well, also by how they dress & act.) Some folks don't make it easy, by dressing as a stereotype that incites hate or fear (EG: a white person wearing a clan robe, a black person wearing a thug outfit, etc).
We are on the cusp of genetic manipulation. When the day comes that someone can change their genetic race and skin color by just visiting a genetic doctor, then racism will be a thing of the past. However, social discrimination based on wealth & poverty will just exacerbate, because then the divide between the "haves" and "have nots" will have increased. People taking advantage of genetic modification will be come more athletic, intelligent, etc than any naturally-born gifted person. And thus ensuring that even those gifted born into poverty will still remain in poverty.
There will always be a reason to hate others or to find differences. Skin color & race just happens to be one of the really, really stupid ones.