It is discriminatory. That's the point. You offer a weighted bias to the demographic that's gone its entire life with a weighted bias against it, because that's how affirmative action works. We'll never agree on this point because we have different starting points and values, but that's fine.
Countering substantial inequalities is difficult. Not sure I agree with them being legally binding, but should be incentivised through soft nudge measures.
It's not the ideal solution, I agree, and alternatives like blind applications (remove all variables of discrimination: sex, gender, race) are much more preferable but don't do enough to counteract the lifelong effects of a system geared to advantage one demographic over another.