I agree with this, but I think we can be more ambitious than just seek to address discrimination when it occurs.
There are reasons why people from certain groups are underrepresented in certain roles and companies. We need to address them, not just engineer things so people from the underrepresented groups are slotted in. Unless they are the best candidates, a host of issues will arise.
In the last 10 years I have worked with people who have massively under performed due to being slotted in as part of a quota. Some of whom had significant potential, and if they had had better early opportunities, or better professional development, would have become shining stars (this is what EDI initiative should be about - getting the best people for the role and not letting them slip through the net due to not having had the right opportunities until 'now'). Some have just been rubbish hires and selected for quota reasons.
I think there are plenty of people out there that think companies should hire people from marginalised groups as this is social justice. Unless they are a charity with this specific aim, this is crazy. Furthermore, it's somewhat discriminatory when done so with an unconscious assumption that those people can't get the job on merit.