It's better to kill them, than jail them for life. It's far less cruel to deprive someone of life and liberty, than it is to deprive them of those same things and make them suffer for the rest of their conscious existence. There's also the financial and logistical cost to society. Last, but not least, we have the social and cultural cost.
The deterrent effects of capital punishment are also severely downplayed - and even propagandized against - by Western media (you're a "raging, right-wing, authoritarian nut," if you're pro capital punishment). It also changes the culture and how people live in very tangible way. Think of the stereotype of the middle-aged and older murderous pedophile loitering in playgrounds to try and lure children. In a society where such was a thing was harshly punishable by death, there wouldn't be this stereotype that exists and the fear wouldn't be commonplace. It would be considered an irrational phobia, since "nobody would do that." It wouldn't be a statistical impossibility, but the instances of it would be extremely low - so much lower than what it currently is in the US and other developed, Western nations that it wouldn't be in the public consciousness.
Of course, you could still have prison sentences for different types of killings. A crime of passion is nothing like a contract killing for an organized crime group, both of which are nothing like killing a four year old and dismembering the child.