I agree with you, but imagine being a discriminatory, but rational asshole.
Of course you're not going to hire a woman if you could hire a man - they might get pregnant and be away from work for a long time.
Of course you're not going hire an older employee that knows their worth over a recent graduate that isn't familiar with the salary they should earn. You can rip them off much more easily.
People can be cunts but still act with some rational motivation. That's why we have protected categories, to make sure that that isn't a strategy worth pursuing.