For example, suppose you're heading an FBI group, and you've got a suicidal terrorist in custody who is part of a plot to detonate a nuclear bomb in LA. You have excellent evidence this guy is involved, and that the terrorists probably have a nuclear bomb in the country, and, if they realize their coconspirator has been captured, they are likely to detonate immediately.
The terrorist demands to see his lawyer. Your specialists say you should deny that request, because his lawyer may signal, intentionally or otherwise, the other terrorists. Should you allow the terrorist to meet with his lawyer?
Our society's laws say he should be able to see his lawyer. We value that kind of thing. And yet, if you would risk millions of lives to protect this right... Well, that seems perverse to me.
https://plato.stanford.edu/entries/torture/
The Stanford Encyclopedia of Philosophy lists a real life example along the lines of my hypothetical one. In this example, a child is stuck in a hot car that is parked in a spot known only to the in custody car thief who is refusing to talk. The police proceed to beat the thief until he talks and save the child's life. This is straightforward example of when pragmatism must overrule idealism.
The purpose of my example was to create a situation where it should be obvious the right move is to go against idealism. The reason is, if your starting point is something like "We must never deny people their rights" I'd like to show you an extreme example where, actually, we must. If you can agree on the extreme example, then the discussion becomes a matter of degree - i.e. when is it okay to deny people their rights versus when it is not. This is actually the more nuanced and realistic discussion that has applicability to the real world.
(edit: now I notice it was written by an Australian)
Before you know it you're torturing people, gassing them or doing other unspeakable things to them because you've worked out some kind of equation where your predicted outcome justifies your horrible actions.
Values only matter when there is a price attached to them, it is very easy to have high standards for morality when they are essentially free.