I would seek the truth first. If there is truth to Ned's claim, I would be a pretty horrible person to resort to murder because I don't like the truth. If Ned lies, he is no threat and therefore doesn't need to be killed. Sending him to the wall, like everyone suggested, would be fine. Especially since I want to avoid a war... And let's be very clear, Joffrey clearly enjoys violence and torture.
Except, the "poor" Joffrey is the one who is to blame for that injury and his mother was incestous and the king was not his father... Ned crime is telling the truth and Arya defending her friend. Ned even foolishly try to give Cercei a chance to get away with her children before he tell Roberts. Ned didn't want their blood on his hands. A gesture of mercy that costed him his head...
Meanwhile Joffrey, who had his wrist ripped up by this man's daughter, then lost who he thinks is his father and then has the same man say his mother and father are incestous and his Uncle Jaime is his dad, decides to put a traitor to this death. Which is what Ned did in episode 1 to that man from the Night's Watch.
Okay, so what would you have done in Joffrey's place? You are the King of the Realms, when some old fool says your dad isn't your real dad and your mother has been sleeping with your brother. Which means you aren't even the legitimate King.
He then tells you in front of everyone that he admits he was a liar and did it to seize power.
Now, before you point out that Ned didn't seek the truth first when he was told about the White Walkers by the man he executed, don't forget this truth changes nothing about the crime: there is a deserter regardless. Ned takes no pleasure in having to carry the sentence.
The penalty for treason is death.
A soldier deserts his post, whilst appearing under great stress is executed by an experienced Lord.
A high lord admits treason to seize power by making up disgusting lies about the monarch - how is this better than the above?