An armed victim != capital punishment. Punishment is different than self-defense.
Of course there are opposing viewpoints. But by RAW those viewpoints are wrong. Torture is evil in D&D.but I'd be playing devils advocate anyways if a person refused to acknowledge the mere existence of opposing viewpoints.
So regarding your "practical argument": are you sure that it is a deterrent? Why do areas with prison-rape have higher crime rates than areas without? Additionally, torture serves to attract publicity; highly-publicized crimes are more likely to be emulated.
And besides: I can name a bunch of people who torture "wrongdoers". All of them are otherwise horrible people who mistreat their populace and/or spouse. If torturing evil people is right, shouldn't I know about some torturers who are really active in community service and help widows and bring joy to their neighbors?