The profitability of the company that discriminates is decreased, and the loss is "directly proportional to how much the employer's decision was based on prejudice, rather than on merit."
In the first one, the employer has a taste for discriminating against women and is willing to pay the higher cost of hiring men instead of women.