Between you, me and the bedpost
The police are treating Sherlock roughly, as if they just caught him in the act. They don’t need to handcuff him, because he intends to go with them willingly. He put on his scarf and his coat; he intends to go quietly. But they cuff him and haul him out anyway, with contempt. That is more than John can bear. It’s unjust.
John wants to see a warrant, for one. At least a warrant. He demands that they treat Sherlock with respect. After everything Sherlock has done for them: all the cases he’s solved for free, after all the good he’s done, this is how they treat him, in the end. The way they wing him around so that he stumbles; I wonder if that’s the point where John starts to seriously lose his temper. Sherlock is a strange creature, but he is, if nothing else, dignified, and the police are not allowing him any dignity at all. They are deliberately humiliating him.
Given John’s fundamentally moral nature, his inclination to defend the people he loves at any cost, the injustice of this arrest, and the willful humiliation of someone he admires while he is helpess to prevent it, it’s no wonder he ends up resorting to righteous violence.
Righteous violence is kind of John’s thing.