There are some hills not worth die on. There are moments when a retreat is better than a worthless fight, saving people in the process.
I did the same mistake working for a company that went from morally sound to "almost-Enron". I thought it is a fight worth taking. The company went its way, I made no difference in the end, I just stressed myself for years for nothing. Life is too short for that.