I'm pretty sure its neurological. Forming biases and stereotypes allows for faster reactions in an emergency or high risk situation. You can react quicker without thinking about it.
Its outside of those high risk situations that it gets you in trouble.
https://www.scientificamerican.com/article/conservative-and-liberal-brains-might-have-some-real-differences/