Using "the end justifies the means" logic leads to an obvious problem. If you believe nefarious means can be justified by a desired end, then you would be willing to use nearly any means to achieve ends you deem very important, and you will use absolutely any means to achieve ends you deem absolutely necessary. But if you do so, the only thing that separates you (whom you consider good) from your enemy (whom you consider evil) is the desirability, nobility, morality, goodness of the ends. Horrible atrocities have been perpetrated by those that believed so strongly their ends were just/right/desirable that they were willing to kill to achieve those ends.
In history there have been those (such as Martin Luther King Jr. and Gandhi) who believed their moral superiority to their enemies must exist in the means, not just the ends. John Howard Yoder's understanding of Christ in The Politics of Jesus also suggests a leader (with social/political ends) who insisted on using a moral means.
Religion does not provide a clear direction. Too often religious motivations have led humans to murderous means to achieve the ends they view their religion demands. And sometimes it is religion that leads humans to recognize a moral demand, a "higher law," which extends beyond the desirability of the end that humans have in view. So religion can lead humans to treat other humans as "means" to be used for transcendent purposes, but religion can also insist on transcendent purposes which forbid certain evil means to achieve human ends.
There is little doubt that torture denies the dignity of the one being tortured. Torture insists that the tortured person is simply a means, a means to be used to achieve the torturer's end. The tortured person does not have inherent value; the value of the tortured person is only his/her value to the torturer. Humans distort, limit, and deny each others' inherent dignity all the time, but violence is perhaps the most intentional, outright, egregious denial.