So, they were right about executing him all along, but didn't anticipate him reviving?
No, they were dead wrong.
They were so afraid of the hero and the sage who saved them that they created the very conditions to make one of them come back as a near-unkillable undead.
One was a peace idiot who abhorred conflict despite her strength and the other would never had started a conflict without the approval of the afore-mentioned idiot. Not to mention killing her gave him motivation to start his rampage. Letting them retire in peace would likely not have created this new demon lord.
It's basically a self-fulfilling prophecy. "They were justified in killing them because he turned into their next calamity... because they killed these two."
So, they were not right. The king is justifying his actions from the bad outcome they resulted in.
It would be like some young thug says that he was justified in killing someone's dog when said someone is coming to kill him in revenge.