On the subject of bad attitudes in social groups with long-term continuity of any kind, be it weirdos at a hackerspace or misogyny in STEM or death threats over Twitter:

I've found that it's so hard to manage and avoid these sorts of issues because the roots of it are laid long before it ever becomes vocalized as a problem. It usually starts with one person who misbehaves in some way and everyone else ignores/allows it because they don't want to be the bad guy who starts the conflict. But it grows from there--the original bad actor grows more bold and/or attracting other bad actors, and previously good actors start to become resentful, start to demonstrate their own bad behavior, especially now that they recognize the environment as tolerating it.

By the time someone says anything about it, passive-aggression has become a large part of the group. Pruning such a large (though not necessarily majority) part of the group could leave the group without the day-to-day support it needs to remain viable.

Note that I'm not calling this out as a failure of any particular group involved in this particular case. The vast majority of organizations either don't have people who are dedicated enough to stick around, year after year, or fall into this habit because they feel (most likely correctly) they lack the authority to do anything about it. Most organizations are not setup from the start to expect bad behavior, and therefor don't have the mechanisms in place to take care of it.

I don't know how to clean up an already existing problem. I suspect that it either takes admitting personal defeat and moving on to something new. There might be something in going after the minor offenders, first, to undermine the support that the long-established people enjoy in these sorts of conflicts, but I doubt such a strategy is not so transparent to throw up red flags.

If you're starting a new organization, I plead to you: always be friendly, always be fair, but always be firm. The first time something even remotely inappropriate happens, you have to say something directly to the offender. I can't even count how many times I've had to chide people for using the N-word (let alone other words that should be as obvious by now). Do it in private, there is no need to embarrass them. Public embarrassment should be reserved for 2nd-time offenders, because if they think they can get away with it a second time, it means they think they are in an environment that will support that behavior, so there are probably others who think the same way and just haven't acted yet.

You'll probably piss someone off in the process, "how dare they censor me?" But you don't need to please everyone. You need only the good people who can play nicely with others.

"Oh, I'm doing it ironically" is not an excuse, even if (in the exceedingly remote case) it's true. Because context is important. You never know when someone new is coming along and doesn't understand the person is "just joking". And there are two ways the new person can react, neither which are good for your organization. In the best case, they will be put off and not return. In the worst case, they will think they've found a sympathetic environment in which they can peddle their own bad behavior.

In the process, you absolutely must not stoop to their level. You must always portray an outward appearance of calmness, even friendliness, regardless of how angry you might be. It has to be clear that the issue is the behavior and not a personal conflict.

And you have to be fair. You have to equally reprimand bad behavior, even when you agree with the actor's thesis. There is no other way to make it clear that you mean business.

You're not going to have a problem with the vast majority of people. You're going to encounter one or two really obvious nogoodniks and it's up to you to be the adult, stand up and inform them that the sort of behavior they've demonstrated is not welcome there. If you don't ignore the elephant in the room when he shows up, you can avoid the much more insidious problems further down the road.