Prime Minister John Key says he is reluctant to criticise police for their failed investigation into the Red Devils motorcycle club.
Charges against 21 members were stayed this week after the High Court ruled the police gave false information to the courts in a bid to boost the credibility within the gang of an undercover officer.
Mr Key says officers are asked to work legitimately in undercover roles because they can gather information that helps to bring about prosecutions.
He says some gangs are at the forefront of the drug trade, which has an awful impact on the community.
Mr Key says he expects police to get things right, but if they don't, then they need to figure out why and take some lessons from that.