I’ve argued in the past that torture is wrong because all torture attempts to use pain to alienate persons from their own self-possession, and it is always wrong to intend to cause such alienation. The word “torture” can also describe acts of physical cruelty or features of punishments, but I leave these outside of the consideration because the first is not morally problematic (we all see that pointless cruelty is immoral) and the second falls under a different set of considerations (the morality of punishments) The morality of torture is the most interesting when it involves the use of pain to alienate self-possession and so obtain information.
STA raises the question of torture in the context of compelling persons to accept the faith. Bottom line: he does not allow it for those who never accepted the faith but he does allow it for heretics and apostates, who have once vowed to accept the faith as confessed. What’s interesting is that one can accept the argument against torture given above while allowing its use to compel heretics and apostates, since a vow once given can never be rescinded and so one can never will contrary to what they have vowed. Taking a vow has to mean that any future renunciation of that law is not an act of reason. Since conscience is already bound one way, it is hard to see how we act against conscience by compelling it that way.
Do I need to say that I’m not arguing for torture here? Well there, I said it.
One difficulty is that torture means everything from cruelty to compelling to a sort of information seeking. The Church and the Enlightenment seemed to be most of all against cruelty or severity in punishment while we are more focused on the information-extraction problem (the ticking timebomb, or whatever). The morality of cruelty is, to be sure, largely a casuist question of particular practices, and if torture is seen this way it tends to collapse into the rhetorical question of “what is torture anyway?!?!” But the question of alienating someone from self-possession by pain is a different question.