To discriminate is not in itself illegal, to discriminate using unfair criteria is illegal. Airlines do not allow unaccompanied minors to travel on the last flight. This is discriminatory. It is also common sense and no reasonable court would find that such actions are illegal.
The act of denying a customer a seat on a plane they have paid for because the airline has chosen to sell more seats that it actually has available
requires the airline to discriminate. There is no other way to deny some people boarding. They may use a variety of methods to undertake this discrimination... last check in, first out; higher level frequent flyers could be immune from selection; etc. I am suggesting that as long as the criteria is clear, in the contracted terms and conditions and is not discriminating on unfair grounds, such as race, gender, sexuality, etc... then it would not be illegal.
Of course, the other solution is to stop the egregious practice of selling something you can't supply.. which in any other industry would be called fraud.