Our minds are wired in a very specific way. From a very young age, we learn about the world by creating new associations and categorizing similar ideas and concepts together. For example, when a baby who dislikes broccoli sees green pistachio ice cream for the first time, it might be reluctant to try it. It also means that when our stone-age ancestors ran into an unknown animal, they would flee when seeing sharp teeth and long claws, rather than risk figuring out what kind of animal they were facing.
We are naturally inclined to make assumptions and categorize things and people. And it can be a good and a bad thing. On the one hand, there is nothing wrong with being careful when meeting a suspicious person in a dark alley. On the other hand, situations are rarely this simple, and making hasty judgments based on first impressions can cause us to misjudge, offend and drive away people. This means that there is nothing wrong with having first impressions of people or internally comparing them with those who are similar. But we must keep learning more about a person and appreciate them for what they are, and not what they seem to be.