You should read the Equal Employment Opportunity Act. None of the things you listed are examples of discrimination in the context
of civil rights. The Equal Employment Opportunity Act.
Perhaps I should also remind you that this isn’t 4chan.
You seem to think the law is the be-all end-all definition of perfect moral reasoning.
The law is not God's word. It's open to criticism, and we're criticizing it. If you want to participate in the discussion, great. But, "It's illegal because the law says you're not allowed to do it," is not a meaningful contribution.
The discussion point was already made above, in that we make certain things illegal because even though it may make economic sense, it results in massive damage to things such as the environment, vulnerable populations and so forth. The poster chose to respond by saying it was a perfectly valid reason to discriminate, which goes against the law for the already stated reasons.
There was no additional criticism offered here. No one has made the point that 'it's the law therefore it's good', and you're massively misrepresenting the arguments here.
And in fact, there are laws against pollution because it's an externality, it doesn't make economic sense to the whole of society. Markets are good at maximising the total good in the case where costs and benefits can be totally internalised. Where you have externalities you see either overprovisioning or underprovisioning and in net, everyone is worse off than the rational outcome. That's where intervention is better than a market by itself.
Perhaps I should also remind you that this isn’t 4chan.