I wonder if this is related to prejudices. A survival instinct.
And just like anything else it can be used negatively, or positively. As long as we don't use our prejudices premeditated to harm others I think it's a survival tool. But when we use them to defame groups of people who are nowhere near us then it can become negative.