Bharara boils down the probable reason behind the firing: "The only sin ascribable to S.D.N.Y. under Mr. Berman’s leadership, it seems, is violation of the commandment to protect the President’s friends and pursue his rivals.... Nothing about the weekend termination was regular or in good faith. It smacks of an effort to get rid of someone perceived to be disloyal in favor of someone more controllable."
In other words, Berman refused to be corrupted by Trump and his attorney general and for that he was fired.
It would be outside the scope of Bharara's piece to speculate what's really going on with this firing. At the end of the day, however, it probably failed miserably. Berman will be replaced by his deputy, who almost certainly will continue to press forward with any investigation and prosecution that has any connection to Trump.
So the debacle was a messy and failed political assassination. Hopefully the whole story will become public at some point soon. We deserve to know exactly how corrupt Trump is and what he attempted to do in this latest of his nearly innumerable scandals.