A judge's decision to halt a Crown case against 21 accused was "unjustified", a police union says.
Justice Simon France has ordered a stay of proceedings in prosecutions of those arrested as part of Operation Explorer - a police crackdown on motorcycle gang members.
During the investigation a fake search warrant, which appeared to be genuine, was prepared.
Justice France said a search warrant can only be issued by a judicial officer.
"This fake warrant, unappealingly described to me by the officers involved as 'a prop', purported to be signed by a judicial officer.''
An undercover officer using the name Michael 'Wiremu' Wilson infiltrated the Red Devils in Nelson and police orchestrated a false arrest to boost his criminal credentials.
"However one looks at it a fraud is being committed on the courts," Justice France said about the false arrest.
Police released a statement today saying that "are studying the judgement released by Justice France today and will be taking advice and considering options".
Police Association president Greg O'Connor said today that the police had "acted in good faith" and were trying to protect the agent's life.
Police "acted with the knowledge and agreement of the then-Chief District Court Judge, Russell Johnson, in doing so", the police union said.
He claimed that this included following his advice not to inform the local Nelson District Court of what was happening.
"To have the court now effectively change its mind is a slap in the face for the agent who put his life on the line for over a year," O'Connor said.
O'Connor said it was "unjustified and disproportionate" to stay proceedings "against alleged serious organised criminals solely because the High Court now takes offence at the subterfuge involved in constructing a credible cover story for the undercover agent".
He said the court is punishing the public with its decision.
"The Red Devils gang will be empowered by this decision and the good people of Nelson will now have to put up with the consequences," O'Connor said.
Justice France also said it appeared the police's conduct had components of committing criminal offences.
''The search warrant would seem to engage section 256 of the Crimes Acts 1961 and the swearing of a false information would seem to engage section 110 of the Crimes Act.''
He said he thought it reasonable to proceed on the basis that no charges would be laid from the police actions.
O'Connor claims that "the subterfuge in building a criminal record for the undercover operative was necessary to reduce the very real risk to his (the officer's) life".
"The fact the agent had an artificially constructed back-story did not cause, encourage or enable anyone to offend. They were allegedly doing that anyway."
Lawyers for the defendants argued the police action was an abuse of the court process and said the charges - which include drugs, firearms and conspiracy to take part in an organised group offences - should be thrown out.
France today agreed it was an abuse of court process.
He said: ''I see the actions of the police in this case as involving serious misuse of the court, and a troubling misunderstanding of its functions.
''Anything other than a significant response runs the risk of being seen as rhetoric. In the end I consider it comes down to how serious one sees the conduct as being, and what price the system is being asked to pay in order to preserve its integrity.
''I doubt a false information about a fictional offence will again be sworn,'' France said.
"Wilson" was charged with possessing equipment to cultivate cannabis in May 2010. He also twice failed to appear in court to enhance his standing with gang members and warrants were issued for his arrest. The charges were eventually withdrawn when the operation ended in March 2011.
Court staff, the judges he appeared before and some police officers did not know the arrest was a fake. However, police have argued the hoax was necessary as "Wilson" was threatened by a gang member.
Police sought the permission of then Chief District Court Judge (the late) Russell Johnson after the arrest, the Nelson District Court was told in July.
Operation Explorer was headed by Detective Inspector Grant Wormald who also supervised the joint FBI-police raid on Kim Dotcom's Coatesville home for the Organised and Financial Crime Agency. Wormald was not a decision maker in regard to the arrest and prosecution of Wilson, police said.
He is facing allegations he lied under oath about illegal spying on the German millionaire. In a court hearing last month Dotcom's lawyer, Paul Davison, accused Wormald of giving "inconsistent" testimony about surveillance by Government Communications Security Bureau (GCSB) on behalf of police.
Wormald had told the court no other agency had been involved in the spying - but it has since emerged GCSB was illegally monitoring communications from Dotcom and his co-accused, Bram van der Kolk, for a month before his January 20 arrest.
Dotcom's legal team have indicated they will lay a complaint with the Independent Police Conduct Authority.