The real question is, "Why did Greyworm specifically disobey Daenerys' orders?"
In the battle meeting with Tyrion, Greyworm and Dany, Dany clearly indicates that the Unsullied would retreat upon the ringing of the bells. Here is the scene, at 16:34 of S8E5,
Tyrion to Daenerys: Please, if you hear them ringing the bells, call of the attack.
Daenerys: **looks to Greyworm and Tyrion and nods curtly, but sincerely**
Greyworm: **micro-nod of acknowledgement**
This order from Dany is clearly disobeyed by Greyworm when he throws the spear and kills the Lannister Ranking Officer when the Lannister forces have surrendered and the bells are ringing. This initiates the pillage (not the burning) of King's Landing.
This is completely contradictory to what we known about the Unsullied, being "famed for their skills and discipline in battle" and "They never loot or rape"1.
It is worth noting, perhaps Dany meant to burn the city all along, and the retreat of her own forces was necessary to burn the city effectively, without loss or casualty to her own forces.
So, Why did the soldiers of the North disobey Jon? Once the Unsullied, the most disciplined of Dany's force, and Greyworm, the highest ranking general, start attacking it sends a message to all her forces to do so. It would be very difficult for Jon, amidst the furore and din of the battle, to effectively control the Northmen.
There is of course the remote possibility that there was an off screen conversation between Greyworm and Dany to attack Lannister forces after surrender. However, there was the opportunity to show this when Dany and Greyworm had a private meeting about Missandei. Therefore, a secret plan between the two becomes even more a "logical leap". This leads me to believe that this is not what the show intended to portray, but rather Greyworm initiated a killing spree out of revenge for Missandei.