Diversity = a Nice-to-have
Well, diversity is a nice to have imo, I'm a gay developer so knowing a company is an open environment and not broish etc is encouraging; my previous experiences at overly broish companies haven't been great. If you're too different, you get judged more harshly.
Companies very often just do robotic diverse hiding but that alone won't work. It's a mindset on how welcoming and open the company is. It usually comes from the top down, so if the leadership is cliquey...
However it can't be at the expense of the company's revenue or hiring the right talent. If someone doesn't live up to their responsibilities, they gotta go. Nor should companies necessarily be penalised if diversity decides to leave. There's few of us, and it's a competitive world. Nor should it discriminate against white cis het men, that wouldn't be fair.
So the situation is not black and white. A load of women quiting could mean everything or nothing or 50/50.