Though I understand the logic, usually someone underprepared getting the job is actually really rare. You have to think that most social notions and behaviours are produced by inertia, and prefering male non-immigrant candidates is the standard, and by no logical reasons, just by mere inertia or prejudice, even when they are indeed under prepared than other candidates.
By "forcing" (rewarding) people to hire non-male and non-national candidates, what you creates is a situation in which those prejudice (immigrant and women are unreliable/worse than national men) start disappearing, and after a while there would be no need for those laws.
I understand that they are, indeed, positive discrimination, but the end will create a better situation. And statistics shows both that this actually works, and that it is still necessary.