Unless the government subsidizes their wages or reduces tax burdens for companies that have more diverse hiring
That's what we do in my country. If you hire only men you generally qualify for fewer government programs. In some cases you cant bid on the job if you don't have sufficient representation for specific groups.