Judge Andrew Napolitano said that the Supreme Court's ruling in favor of a baker who refused to craft a wedding cake for a same-sex couple could set a precedent for religious discrimination in future cases.

The Supreme Court on Monday ruled in favor of baker Jack Phillips in a 7-2 decision, after the couple filed charges against him in 2012.

Phillips had refused to bake the couple's wedding cake due to his religious beliefs against gay marriage.

"I think this is a dangerous opinion," Napolitano said of the ruling on "America's Newsroom."

"It will allow others to say, 'My religious beliefs prohibit me from dealing with women or Italians or African-Americans,' and they will base it on the logic in this case," he explained.

Phillips was sanctioned by the state civil rights commission after a formal complaint from the couple.

"The Commission’s hostility was inconsistent with the First Amendment’s guarantee that our laws be applied in a manner that is neutral toward religion," wrote Justice Anthony Kennedy in his majority opinion.

“With respect to this case and this case only, the baker prevails because the baker’s decision not to bake the cake is rooted in his religious beliefs.”