Executing the guy after the first murder would have saved at least one life, maybe more. There is only one way to prevent murderers from killing again, and that is to execute them.
Prevention is a secondary reason.
Execution is simply what the worst murderers deserve.