Ignorance, Insecurity (i.e, unaware of cultures other than their own very limited ones, or the vast benefits of learning about them or learning in general; and fear of the unknown largely due to this same stupidity, and the tendency to handle this perceived threat in a reactionary, animalistic manner). Such people often just go along others, having no confidence in themselves, and thus the tendency to gang up ("safety in numbers"). Please note that educated, intelligent persons are far less likely to have such prejudice, although the impact of their national or local culture still can be very strong (such as in India, where a caste system persists).
In addition, prejudice, hatred, and tribal behavior has been further promoted by some politicians and other petty leaders, who got there largely because of the same human tendencies to band up and look for direction, so they just pick a popular concept (fear is one of the best) and preach about it to get votes at emotional gatherings, thus inciting more hate and violence.