In all groups of people, especially when those groups are as big as a whole society, there will be differences between people. People will not have the same levels of intelligence, the same attitudes, or the same emotional responses. As societies, we essentially decide how we will conceive of these differences. In our society, we have chosen to see many of these differences as based on race or sex or, to a lesser extent, class.
In our society, we are particularly likely to define people based on their sex or their race. This may be because it is so much easier to identify these things than to identify their economic class. We have very clear images of how people of different races are supposedly different and how men and women are supposedly different. We reinforce these views all the time. We do political polling and analysis based on how Latino or African American voting behavior differs from that of whites. We analyze how men and women vote differently. We run all sorts of diversity programs highlighting differences between races and between the sexes. In these ways, we tend to strengthen our propensity to look at things in terms of race and gender.
Differences between people are defined in terms of race and gender (and by class at least a little bit) because that is what we choose to do. We label these as salient differences and then we do many things to reinforce that perception.