Religious institutions are not the best example since they have exemptions and protections that are not applicable to non-religious private entities and institutions.
What you have been focusing on is firing someone for dressing in accordance with the typical dress of the gender they identify with. That is far different than firing someone because they have alienated a group of people through unsolicited public comments about those people and done so in a way that threatens your bottom line. Two very different things.
Not talking about a religious organization. Just a private citizen that wants to run a particular type of business and cater to certain segment of the population. If ESPN can fire someone over a private message that supposedly offends their audience, does a business owner have a right to fire an employee that offends their clients.