While I don't think it's worth the price, torture is a complex issue.
If a person is coming at a loved one with a knife brandished with the clear intention to actually kill them, then killing the person to defend an innocent isn't considered morally or ethically wrong (assuming no other options exist).
The question is, how far can that scenario be expanded? - if you knew pretty much certainly that by torturing somebody you could again prevent the death of an innocent, would you do it?.
In the top scenario it's much easier, they had a knife - it was clear the intention & they were most certainly the guilty party.
If the bottom, it's not as clear - they may not really have a bomb, they may not actually know or be the guilty part (outside of watching somebody commit a crime, our justice system makes mistakes).
As a form of punishment it's utterly barbaric, as a means of gaining information it's not really very reliable.
If less dehumanising methods of obtaining information exist, they should be used - but on the finer points of the ethics involved, I can't say for certain.
Really, it may be one of those actions which can only be justified with the benefit of hindsight - personally, I'm inclined to be against the act altogether, as the few lives gained as a result, are likely to be lost through the degrading of our humanity in the long term.
It may be another issue where the ethical stance "Those who sacrifice a little liberty, for a little safety - deserve neither" may apply.
But saying all that, if we accept that the first scenario can be ethical - if we can kill another human to prevent the death of others, it's not much of a leap to allow torture - but note, these are both with the intention to prevent further death, not used as a method of punishment, it would also be under the same kind of conditions (certainty, not simply just being suspected of something - to make it match the same criteria as the knife case - which without hindsight, may be impossible)