Earlier quoted context omitted.
The law says that it is "sexist" (i.e. discrimination) to target advertising in a way that denies qualified women the opportunity to apply for a particular job. In the end the net result of targeting only men is the same as refusing to hire women, it denies otherwise qualified women opportunities that they are deserving of. That this has a cost is understood by those who wrote the law, they decided those costs are wo…
Which law specifically states what you say? It's one thing to target a gender in your advertisement. It's another to deny someone a job based on their gender.
Imagine the job posting was in the men's toilet. The company would have a hard time arguing women had fair notice.