Every law discriminates between people. We discriminate, for example, between people who commit crimes and those who don't. The question, then, is what kind of people may we discriminate against?
One answer is to say that we should discriminate against people whenever the conduct we are trying to prevent would harm our society. For example, it should be legal to discriminate against young people. If we allowed 12 year-olds to drive, it would probably hurt our society. We should probably be allowed to segregate men and women in bathrooms. If we required everyone to use the same bathrooms, it would most likely result in women having to feel very uncomfortable, which is a form of harming society.
Here is a well known SC case on so called discrimination. Was the ruling correct in your view coolchick?
Additionally, Affirmitive action, in my opinion, is discrimination, so called Reverse Discrimination.