Both the interrogator and the subject know which information is verifiable and which is not, torture doesn't create a reliable source of information.
You’d tell them that you’re guilty even though you are innocent because you’d want the pain to stop.
That’s why people say that confessions gained via torture are not reliable.
But if you capture a soldier and want to know where his friends are, what their plans are etc it's probably worth a shot. You can often verify information and ask followup questions etc. I'm not saying it's the moral thing to do, I'm just saying I think it'd have a non-zero success rate. Maybe even a pretty high success rate. And honestly if I was Ukrainian I'm not sure I'd have any moral obligations to torturing some Russians either. As far as I'm concerned when a nation attacks another they forfeit any kind of human rights. If they wanted to stay safe they could have stayed home.
In contrast, if you convince the subject to give up information voluntarily, it may provide you not only the location of the military base, but also much more valuable information about the base and its content, and information you didn't know to ask for.
I think most of those people believe torture works AND is also justified to prevent "greater evil", because that's how it is being presented repeatedly in media.
It's still a quite popular trope in TV series that the protagonists "were forced to take drastic actions" to prevent "the bad people" from executing their plan.
They sometimes feel torn about doing it, but in the end it is portrayed as necessary and effective in stopping whatever threat...