There is plenty of research showing that low general intelligence in childhood predicts greater prejudice towards people of different ethnicity or sexuality in adulthood.
Meg Stalcup, Joshua Craze, Washington Monthly. March 10, 2011.
Increasingly, American beat cops are exposed to virulently anti-Muslim teachings, by self-styled "terrorism experts" with no experience in national security.
The good news is that our prejudices are not inevitable -- we can fight them with broad social efforts to challenge stereotypes and by working together across group lines.