Joffrey made the right decision here (From the Lannister POV)

Cersei, Tywin, and Tyrion try to put him down and blame the war of the five kings on him when really he saved all their asses.

So let's say Cersei got her way and Ned was spared and took the black. This is a massively stupid decision for the Lannisters to do. The kings road to Castle black snakes through the Riverlands and the North. Two places that are loyal to Ned. The Riverlands has also been fighting Lannister Goons for months at that point. Beric Dondarian could straight up just get Ned off the Wagon and he'd be fine. Then he'd call the Bannermen of the North to fight for Stannis. So Stannis would have his army, the North, the Riverlands, Probably the Vale and Renly would definitely bend the knee so the reach too. All against Lannisters. Cersei would have doomed her family.

Now let's say Jaqen H'gar was on the wagon to kill Ned (this is a theory I agree with.) The optics of this is terrible. Having an assassin kill Ned would not cool tensions and everyone would see Joffrey as a craven king.

A war between the Lannisters and the Starks/Beratheons was basically inevitable due to Jaime Caitlin and Littlefinger. So Joffrey handled that situation in the best way possible. He projected strength.

Cersei, Tywin, and Tyrion try to put him down and blame the war of the five kings on him when really he saved all their asses.

So let's say Cersei got her way and Ned was spared and took the black. This is a massively stupid decision for the Lannisters to do. The kings road to Castle black snakes through the Riverlands and the North. Two places that are loyal to Ned. The Riverlands has also been fighting Lannister Goons for months at that point. Beric Dondarian could straight up just get Ned off the Wagon and he'd be fine. Then he'd call the Bannermen of the North to fight for Stannis. So Stannis would have his army, the North, the Riverlands, Probably the Vale and Renly would definitely bend the knee so the reach too. All against Lannisters. Cersei would have doomed her family.

Now let's say Jaqen H'gar was on the wagon to kill Ned (this is a theory I agree with.) The optics of this is terrible. Having an assassin kill Ned would not cool tensions and everyone would see Joffrey as a craven king.

A war between the Lannisters and the Starks/Beratheons was basically inevitable due to Jaime Caitlin and Littlefinger. So Joffrey handled that situation in the best way possible. He projected strength.