I wouldn’t say it’s ever a case of one flat rule across the board. Take into context of how God punishes the Jews for turning away from him, this in turn causes them to repent. The means, be it, harsh in their eyes at the time, brings about change, and after they repent, living their lives now in his graces being far better then living without, without his intervention.
My own life, things happened for a reason, at the time, I consider it harsh treatment, but looking back, realizing it’s necessary for spiritual growth. Yes, I’ll complain during the times of tribulation, but afterwords, realize it’s part of his plan and being brought closer to him, the pain and suffering was worth it.
In the case of torture, that’s unrealistic, we have other means to gain information without harming the individual luckily, and what ever information you typically derrive from the use of torture is not necessarily the truth, it’s word play to stop the suffering at the moment.