Fear
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.