The logic is really quite simple.
If the threat to the American people (or whomever) is sufficiently
great to justify my torturing someone, it should be sufficiently great
that I'd be willing to die or go to prison to meet that threat.
If I am not willing to face a death penalty — or far more probably
some government agent isn't willing even to do serious jail time — then
the situation isn't serious enough to warrant torture.
In any event, torture should be treated as a crime as serious as
murder, and punished as severely. If there are mitigating circumstances,
such as actually finding the ticking hydrogen bomb (so to speak) and
saving Dallas from annihilation, let the relevant Executive commute the
sentence after a few years of imprisonment, and perhaps give the
criminal a medal.
If torture is not treated as a major felony, it can become routine, and far too often, it does.
If patriotic cops and CIA agents are unwilling to risk execution or
even just a few years of hard time to prevent some disaster, they don't
find the threat existential — and they're probably correct.