> Say you have 10 job openings for which there are 5 qualified men and 1000 qualified women.
Notice how you already constrained the number of men so that it has to be 50/50 representation, because you only have 5 qualified mean in your example. In reality, there are a lot more than 5 qualified men. There may be as many qualified men as women. There may be more qualified men than women. There may be fewer qualified men than women.
The proportion of qualified men to women is irrelevant. It's illegal to make hiring decisions based on gender because gender is a protected class. You can't discriminate against women and you can't discriminate against men. You need to choose the most qualified candidates for those 10 position. It may be 50/50, it may not be. You don't know the distribution of the 10 most qualified candidates.
If the company wants to spend more money on outreach to increase the pool of applicants from a certain group, that's legal. However once, they are in the hiring funnel and competing with other candidates for a position, you legally cannot make hiring decisions based on gender.
How much the company spends on outreach to recruit under-represented groups is up to debate. I personally think that budget should be decided like any other budget. It should be evaluated as an investment. What are estimated benefits relative to the amount of money invested worth it relative to other ways that money could be spent?