The issue of torture is an immensely grey area. It's something we, as civilised people, should instinctively revile. What if one of our cities suffered a catastrophic strike with many thousands of lives lost, however? And it became known that the intelligence services were holding an individual at the time of the strike who they knew was aware of all the details of the attack? Said individual wasn't tortured due to legal reasons and kept quiet. The strike was carried out successfully and devastatingly. Do you think Joe Public would find that acceptable? I wouldn't find that acceptable, to be honest.
On the one hand, we make torture legal using a system of checks and balances that limit its usage to extreme cases - perhaps have some kind of judicial warrant system. However, something along these lines was tried in Israel and "extreme cases" turned out to be a slippery slope down the severity scale.
On the other, we make sure it remains completely illegal so there's next to no chance of it filtering down into more common law-enforcement usage. Back to the doomsday scenario - what if individuals hide behind that prohibition for moral reasons or reasons of self-preservation - even in the face of a direct and looming threat to innocents? Torture in such a predicament seems a fair last resort, but if it's not legal, we couldn't be surprised if officers of the law decided they won't use it - despite the fact it could conceivably save scores. Point if, if there is no legal recourse to torture, there's a danger that it will not be used even when it is arguably immoral not to do so.
Despite the flaws, I still like the latter option. It's far from a perfect solution - and I doubt one exists - but officially and for the record, we must never use torture. Officially. But being 100% against torture all the time is reckless.