The bill changes two pieces of legislation - the Misuse of Drugs Act and the Psychoactive Substances Act to allow people to get their drugs tested at festivals without prosecution and permits event organisers to host testers.
Little said the law change was a "safety measure".
"The reality is, with the music festival season upon us, we know that some people who attend those festivals partake of recreational drugs and substances," Little said when he introduced the bill yesterday.
"They purchase those substances and sometimes they do not know exactly what they are getting when they purchase them, and there are risks associated with that."
National's justice spokesman Simon Bridges was strongly opposed to the bill because it normalised taking Class A drugs.
Bridges said it was the drugs themselves that were killing people - not what they were cut with.
"No ecstasy pill is safe - not a single one of them," he said.
Bridges said the Government's intent was to expand pill testing from festivals to "all over New Zealand".
"On our streets," Bridges said.
Bridges said the Government didn't have the "courage of their convictions" and the law was essentially decriminalisation by another name.
In the first reading, Green Party drug reform spokesperson Chloe Swarbrick said the National Party was spreading "seeds of doubt" which, she said, "kind of makes my blood boil".
"I do not endorse people having car crashes, but if they're going to crash, I want them wearing a seatbelt. I do not endorse people taking drugs, but if they are going to do so, I want them to be as safe as possible."
She also quoted a character in the movie Mean Girls: "Don't have sex, because you will get pregnant and you will die".
"That is, effectively, the same kind of abstinence-based, insane approach that is being advocated for by the National Party, and Simon Bridges stands up and goes, "Why is everybody looking at us like we're dinosaurs?" said Swarbrick.
At the bill's final reading, Swarbrick said the National Party was "high-horse moralising".
Act leader David Seymour supported the legislation because it didn't encourage drug taking but would reduce harm.
He said the National Party hadn't presented any evidence that pill testing led to an increase in drug use.
"We should be in favour of people like Know Your Stuff ... that should be the conservative position on this, but it's not."
Seymour said the bill was one of the examples of urgency being used correctly - when there was a time-sensitive need for a law to be passed.
"There is actually urgency."
Māori Party co-leader Debbie Ngarewa-Packer said they took a health approach to drugs instead of a criminal one.
"For us, this is not about normalisation of drug use. Our rangatahi are going to make mistakes.
"They're going to make decisions. This is about us as whānau doing the most that we can to keep them safe and mitigate harm."
The Government attempted to bring the law change in the last term but it was blocked by New Zealand First.
Know Your Stuff, which has been pill testing for six years, said it was glad to escape the "legal limbo".
"We look forward to drug checking being available to all who can benefit from it. That goes beyond festivals where, let's face it, we're serving a mostly well-off, young, and white crowd.
"Our overall goal is to be part of reducing harm for everyone and anyone who uses drugs."