Maybe the king shouldn't execute her. It sets a pretty bad precedent for any other person who might want to reveal a conspiracy they are a part of, but wish to get out of it. This time the real spy was revealed and a tragedy stopped all thanks to Eliza. Certainly, she would deserve some kind of punishment, but executing makes sure every other hiding conspirator wouldn't even dream of revealing what they know, instead they would continue to damage the kingdom, having nothing to lose but everything to win.