Eich was not fired. He chose to resign. Maybe he did so because he cares about the foundation and didn't want to be a distraction. Maybe he was told he'd better resign or they would lose their funding and have to lay everyone off. We don't know, but the insinuations of the original story are out of line for implying so. The truth is we just don't know.
This isn't some free speech issue or some form of inquisition trying to purge the unbelievers.
Eich chose to wade into a controversial issue by making political donations (after all, a conservative majority of SCOTUS claims money == speech). Those "free speech" statements offended a bunch of people and he chose to resign rather than drag the non-profit Mozilla foundation through an ordeal over it.
Anyone in a leadership position is certainly free to make any statements or support any political cause they want. Employees, customers/donors, etc are also free to loudly complain or refuse to associate with the organization if they disagree. That comes with the territory. We wouldn't give Eich a pass if he were sending checks to neo-Nazi organizations. A leader always takes a risk that they'll piss people off by taking a stance. He was CTO of Mozilla at the time, he knew what the consequences could be and made the donation anyway.
A few decades ago it was accepted that blacks and whites shouldn't intermarry. Even some people who campaigned for civil rights still held such a view. If Eich were donating to a group promoting a constitutional amendment to outlaw interracial marriages almost none of you would be wringing your hands over free speech. Everyone would laugh at him for being a dumbass and move on with their lives.
Freedom of speech is not freedom from consequences. Even if someone faces no offical sanctions for speaking out, they can certainly be excluded socially, even to the point of being driven out of the organization. That's how human group dynamics have always worked since we were grunting at each other and throwing pointy sticks.
Furthermore, technology has always been intertwined with personalities, politics, and the like. Only very rarely is it always 100% about the pure technology. You can write the best code in the world but if you can't play nice with others you run the risk of your code languishing in obscurity.
Social norms are changing; you can change with them, you can keep your mouth shut about it, or you can fight for the status quo. Each of those courses of action has risk associated with them. Eich chose to fight for the status quo, then chose to stick by his guns when it pissed a lot of people off, including a lot of the very people his organization depends on to contribute money and code from their own good will! That has consequences and it always has.