The death penalty simply is not a deterrent, there have been numerous studies backing this up (here's one:
http://www.deathpenaltyinfo.org/article.php?did=1705). It's simply a punitive measure.
A nuclear weapons arsenal, in my opinion, is a deterrent...to the use of nuclear weapons. The Cold War remained "cold" (nuclear weapons-wise) largely because of deterrence. I mean, come on, if you have 150 nuclear weapons and the other guy has 150, are you really going to launch against him?
Also, there is a lot of misconception when it comes to what "nuking" entails. Nuclear weapons have their limitations. Ultimately, they are just like any other weapon, it's just that the scale is larger. And while "unleashing all the nukes in an orgy of Armageddon would be a pointless and insane act" is very true, that's not really a multiple-release strategy, or the reason countries stockpile these weapons. You can launch, say, 10 at different targets of an enemy and the world won't end. Millions will die, of course, but the world won't just blow up.