Dude won 71% of his games. He's basically been their best manager since Pep (better record less trophies than Flick).Nagelsmann's record at Bayern isn't very impressive by their standards. At this point, winning the league is the minimum expectation and its what you do on top of that which counts. Last year he lost 5-0 to Gladbach in the DFB Pokal and, more importantly, go knocked out of the CL by Villarreal. You are right that he is doing great in the CL this year but Bayern are also in more danger of losing the league than they have been in a decade.
Nevertheless, that's not a record that gets you sacked in late March on its own. There are rumors flying that he clashed with some of the sporting directors at Bayern and wasn't well liked by some influential players. Who knows what happened but I think something like that had to be part of it.
Again, I get it if they think he's a smarmy know it all (and I've heard of some -some, not all- players not liking his tactical communication) but it's still absurd. And short sighted. They basically lit $25m on fire.
What you seem to be defending is that unless Bayern (or any of the other Huge Teams) don't win every title their manger should be on the hot seat. That's a horrible way to run a team or a business.