Snape might save Harry because he secretly admires Harry's courage. Even though he doesn't show it, he knows that Harry is constantly facing danger and yet still stands up against the Dark Arts. Umbridge's actions towards Harry are clearly wrong in Snape's eyes, so he decides to intervene. It could also be part of Snape's long - term plan to keep Harry alive for the final battle against Voldemort.
In fanfiction, Snape could save Harry from Umbridge because he realizes that Umbridge is a greater threat to the stability of Hogwarts than he initially thought. Harry is a key figure in Hogwarts, and if Umbridge were to permanently harm him, it could lead to chaos. Snape, despite his dislike for Harry, values the order of Hogwarts. Also, there could be some hidden connection or prophecy that Snape is aware of, which makes it necessary for Harry to be saved from Umbridge at that moment.
One possible reason could be that Snape still has an underlying sense of loyalty to Dumbledore. Since Dumbledore cares about Harry, Snape might step in to save him from Umbridge's cruelty. He doesn't want to see Hogwarts turned into a place of unjust persecution under Umbridge's regime, and Harry is a symbol of the resistance against that.