Even your example of being treated poorly for being Mexican doesn't apply to all of America. It surely doesn't apply to my relatives or acquaintances.
We all do these kinda of judgments because its a key way our brains work in the moment, and its very useful for survival. That does not mean its always right or useful to do so and we should be thoughtful about when it happens.