Undercover police work is probably the most dangerous public service anyone can be asked to do in this country. As an ordinary citizen, I don't find it offensive that police would fake a prosecution to protect someone's cover.
I find it harder to credit that a High Court judge would let 21 people off criminal charges to demonstrate judicial indignation.
If you didn't read the news closely, or heard it only on TV, you might have the impression the phony prosecution was the one that was thrown out this week. It wasn't.
The charade was done in a district court sometime earlier and Justice Simon France concedes it did not prejudice the case in front of him.
Nevertheless, he decided a stay of prosecution was necessary to protect the courts from deception and declare that the police must not abuse its procedures to assist a criminal investigation. Really?
The integrity of the courts is obviously important, possibly as important as an undercover agent's life. Information sworn before an officer of the courts is our best assurance of truth in all the transactions of life.
It is vital that nobody dares trifle with it.
The ruse that raised the ire of Justice France does sound a bit silly.
Nelson police infiltrated a group called the Red Devils Motorcycle Club that they believed could become a chapter of Hell's Angels. When they thought one of their covert operators was coming under suspicion they planted some drug equipment and stolen goods in a lock-up they had hired for him.
They forged a search warrant that purported to be signed by a court official, then summoned the owner of the lock-up who had to come quite a distance to open it for them.
The undercover constable was duly arrested and charged. The plan was to have him plead guilty and get convicted quickly. But a complication arose when the Red Devils decided to get him a serious lawyer.
Proceedings became drawn out. For the sake of realism, and since he was out of town anyway, his handlers had him miss call-ups in the Nelson District Court. Twice a bench warrant was issued and a bail breach charge was laid.
Justice France tells this story without a trace of the amusement it arouses in me. "Soon after," he says, "the operation was terminated and police sought to have the charges withdrawn."
It is probably not unusual for undercover police to be caught up in the criminal activity they are investigating and to be prosecuted for the sake of their credibility. But this is the first case Justice France can find that was deliberately set up for that purpose.
For unintended prosecutions the police have to get permission from the Chief District Court Judge to use the undercover agent's false name, and that was done in this case too.
But Justice France thinks the Chief Judge, the late Russell Johnson, was not aware that this one was a complete set-up and that this would have made a difference to Judge Johnson, who I knew when he was a very popular prosecutor in Auckland.
Maybe the police deceived him. They were a little deceptive in their testimony to Justice France, not letting on initially that they had written their guidelines for a planned prosecution after the event.
Yet he prefers to conclude they did not intend to deceive anybody and believed they were acting legally. They were merely "reckless" and "unwise" not to have sought wider advice.
Why, then, did he find it necessary to undo all their work and grant the 21 arrested a stay of prosecution?
"A fraud is being committed on the courts," he said. "The judges who are dealing with it are being treated in a disrespectful way. Their time is being taken up with a fiction."
Forgive me some disrespect; time is not exactly a priority in the judicial process, as anyone who has answered a call to jury service well knows.
More seriously, Justice France declared, "It is no function of the court to facilitate a police investigation by lending its processes to the false creation of street credibility. The courts are not part of police investigation. There is and can be no suggestion of collaboration."
Fine words, if they were true. What about when undercover officers are allowed to be charged under a false name?
"Perhaps the two situations are quite similar," he concedes, "But from my viewpoint all that does is call into question the correctness of the false name practice." Oh dear.
Undercover police work happens a long way from a High Court bench. It is not only dangerous, it is difficult. It has to deceive innocent people as well as the guilty if the agent is to be effective and safe.
When judges can help, I think they should.