Smith repeatedly sparred with Justice Minister Andrew Little during the bill's third reading last night.
When Smith told the House that National supported free speech, Little interjected: "Putting yourself above the law. That member put himself above the law."
Smith continued, referencing controversial legal cases including Arthur Allan Thomas, David Bain and Peter Ellis.
"It is my view that our judicial system is made stronger and that our system of law in being able to challenge and question is fundamental to a liberal democracy."
Little: "Not affected by the law — not affected."
Smith: "The charge of a criminal offence will have a silencing effect. It will have a chilling effect on responsible people being able to properly question and challenge the intent of our judiciary."
Little: "The member is just totally wrong."
Smith said like-minded countries including Canada, the US and the UK did not make it a crime to criticise the courts, but Little used the UK as a case of why the bill was needed.
He cited a 2016 front page of the Daily Mail that called judges "enemies of the people" over a ruling about Brexit.
"Absolutely appalling - absolutely appalling - and in any other civilised country, the Daily Mail would have been held in contempt of court," Little said.
"Well, that can now happen in New Zealand, because we cannot have the situation where our courts, whose duty and responsibility it is to administer the law impartially and without fear or favour, come under that sort of egregious, indefensible attack."
The bill also means that jurors can be fined if they sought out their own information beyond the courtroom, including on the internet.
The bill was originally in the name of former National Minister and Attorney-General Chris Finlayson - who has said he was "bemused" by National's opposition to it - but it was adopted by the Government.
It passed with the support of Labour, New Zealand First and the Greens, with National, Act and Jami-Lee Ross opposing.