He says that threatens the integrity of the UK.
Under the proposed legislation, London would unilaterally regulate United Kingdom trade and state aid within Northern Ireland, in violation of the Brexit treaty, which requires Brussels to have a say.
The House of Commons passed Prime Minister Boris Johnson's proposed bill in a vote on Monday evening by 340 to 263, with results coming in around 10:30 p.m. local time.
The EU says Mr Johnson's bill would collapse trade talks and propel the United Kingdom towards a messy Brexit while former British leaders warn breaking the law is a step too far.
Sajid Javid, Conservative MP and the previous Chancellor of the Exchequer (finance minister, in other words), had also come out against the bill, saying in a tweet that he could not see why it would be necessary to break global law in the instance of the Internal Market Bill.
The Government claimed the move was necessary in order to protect British sovereignty and allow goods to move to Northern Ireland unimpeded.
A senior Government source said they were "engaging" with MPs, but insisted that the official position on the Bill remained unchanged.
MPs will begin detailed line-by-line scrutiny of the Bill on Tuesday, with votes expected next week on amendments to the Northern Ireland provisions which some Tories may back.
Speaking to reporters on Monday morning, Mr Cameron said: "Passing an act of parliament and then going on to break an global treaty obligation is the very, very last thing you should contemplate".
"We signed the withdrawal agreement in the belief that the European Union would be reasonable", but now the government must seek an "alternative" and an "insurance policy" in order to "protect the integrity" of the UK, Johnson told the Commons on Monday.
He said it could mean levies of 61% on Welsh lamb, 90% on Scottish beef and 100% on Devonshire clotted cream, and would "carve tariff borders across our own country".
"We cannot have a situation where the very boundaries of our country could be dictated by a foreign power or global organisation", he said.
British lawmakers on Monday backed a new bill that would override parts of the Brexit treaty struck with the European Union past year, despite outrage in Brussels and alarm at home over such an overt breach of worldwide law.
For Labour, shadow business secretary Ed Miliband - standing in for Sir Keir Starmer who is in coronavirus self-isolation - said Mr Johnson had only himself to blame for signing up to the Withdrawal Agreement.
"Either he was not straight with the country in the first place or he did not understand it", said Miliband.
Meanwhile, a Conservative Party former cabinet minister has said it would be "unacceptable" to breach worldwide law with legislation to override the Brexit divorce deal.
"Because a competent government would never have entered into a binding agreement with provisions it could not live with".
Former culture committee chair Mr Collins added his name to an amendment from Tory backbencher Sir Bob Neill which would impose a parliamentary brake on their implementation.