Fear of difference to be more precise
Someone who doesn't look like you, act like you, speak like you, think like you is different. And different always makes people fearful and nervous.
People are comfortable within their own little boundaries and anything outside of that comfort zone makes them nervous and gives rise to such situations as racism.
The unknown is something that a lot of people have trouble dealing with. Since you don't know what it is, you can't control it, you can't feel IN control of it and again, that makes people nervous.
This is a simplified version of what I am trying to say, but one that I believe is ultimately correct.
People need to feel like they understand, and what is not understood is feared and fear can sometimes give rise to hatred or lashing out simply as a means of keeping that fear at bay or a distance.
Racism develops as a result of one human feeling and thinking he/she is superior to the other. Even among the people of the same race, classes occur. If not black/white/Caucasian, it could be rich/poor, brilliant/dull or any other form of 'I am more superior than them' factor.
Everyone is black in my country even though there are over 250 different tribes and languages. Guess what! Tribalism is the order of the day. This is just saying that man will always find means or characteristics that seem to make him superior to a fellow man and try to create class out of it.
Great question. Even though I could philosophy a lot on this certain topic, the answer is somewhat simpler.
What I believe is the main cause, despite the probable wrong ways of raising children (it goes way back in the family tree - as our ancestors were raised wrongfully as well), is the programming we are undergoing for centuries, if not longer.
The program so good that it made us to forgot what we truly are. You see, I am you and you are me. Below these skins, and everything you think defines "who we are", we are identically the same. We are all one - connected, just like the picture on my avatar.
That is why, from the ancient ages, people in power or the Elites (call them however you want) did all they could (in their power) to divide us on as many levels as you can imagine.
Today, we are divided not only by race, nationality, genders etc but so much more. Just think about it, people divide themselves based on the club they are cheering for (illusion), so yeah. I think this one is pretty self-explanatory
Until everyone realize how we are all one, identical (divine energy expressed in the Universe that gained consciousness through the brain), the BS will continue & the people/entities in the shadows (you aren't even aware of) will continue to grab everything on their path & use us as a RESOURCE!