Rick Santorum on Thursday compared gay marriage to polygamy when students challenged him on his opposition to the institution, the New York Times reported.

Santorum made his remarks during a campaign stop at New England College in Concord, New Hampshire.

Students lined up to openly challenge the former Pennsylvania senator after he gave his opening remarks, which included stating that all men are created equal.

“Don't you have to make a positive argument that the law should be change?” he asked the crowd. “You, the person who wants do this, tell me, what is the justification? What is the public purpose?”

Santorum, who placed second in Iowa on Tuesday behind Mitt Romney, dismissed the argument that gay couples want to marry so that they can visit each other in the hospital.

“If it makes three people happy to get married, based on what you just said, what makes that wrong?” Santorum asked.

“That's irrelevant,” the questioner answered. “In my opinion, yeah, go for it. But what I'm asking you is how do you justify your beliefs based on these high morals you have about all men being created equal?”

“God made man and woman, and men and women come together to have a union to produce children, which keeps civilization going and provides the best environment for children to be raised,” said Santorum, who then shifted the topic.

At the end of the town hall, the subject of marriage equality returned and many of the students booed Santorum as he exited the hall.

(Related: Rick Santorum: gay people should remain celibate.)