First, it's a shame for the show from a story perspective, because I really enjoyed Ralph on the show, and they were just setting up him and Sue to be an item, which I was looking forward to.
Second, it makes perfect sense that they'd fire him over this. They have a brand to protect. "They" being Berlanti Productions, which is doing a TON of shows now, all oriented around the DC superheroes. I mean, everyone who watches these shows sees how week after week they pretty proudly hit "woke" themes and social issues head-on. The production company has a point of view, and its brand is not just that they make superhero shows, but that they make socially aware, progressive-value superhero shows. Some don't like that, some don't care, some like it, but that's all beside the point.
The point is that if your brand is "socially aware, progressive-value superhero shows" having one of your heroes played by a guy who has a record of making statements that run directly counter to that brand just because he said "Oops. I'm a different person now that the company of socially aware, progressive-value superhero shows is cutting the checks" opens your brand up to potential damage. Suddenly, you look a lot less socially aware and progressive-value-driven because you continue to employ a guy who maaaaaaybe is a closet racist/misogynist/homophobe. I mean, why risk it?
It is also potentially noteworthy that, contrary to how James Gunn's coworkers sprang to his defense, you aren't seeing anyone -- including the actor himself! -- defending Sawyer. Instead of "That's NOT who this guy is anymore," it's "Whoa....this sucks. I'm really saddened by it." Maybe that suggests he's not really all that different, maybe it highlights other on-set friction, maybe it's just people protecting their jobs. But whatever the case, it still makes sense to me that they'd fire Sawyer. You do not endanger the brand.
Third, this is the second high-profile departure from a Berlantiverse superhero show. I've been hearing mixed reports on the Batwoman situation, saying that their going to simply re-cast the role in one case, and in the other that they're just....bringing in a new character altogether to be Batwoman. It makes me wonder if Elongated Man will simply....disappear, and Sue with him, or if they'll recast the role or something. I mean, if you're having Elongated man, you could just have him say he's gotten better control of his powers and wanted a new face like a new haircut or something. That's a lot tougher to do than recast Kate Kane, though.
Anyway, I guess they have some time to figure this all out. Not like they're gonna be shooting any time soon.