Andrea Leadsom, a committed Christian, said she disapproved of the gay marriage law because it had upset many Christians.
She stressed, however, that she was in favour of marriage equality and that the love of same sex couples is "every bit as valuable" as that of heterosexual couples.
The Prime Minister said he was "extremely proud" of having introduced same-sex marriage in the last parliament - despite opposition of many grassroots Tories - and that it now had the support of an "enormous" majority of MPs.
His comments will be seen as a slap-down for Ms Leadsom who has said that, while she now supports gay marriage, she abstained in the Commons vote and would have preferred to see civil partnerships extended to heterosexual couples and marriage kept as a Christian service for men and women.
Mr Cameron, who is attending the Nato summit in Warsaw, said he would not be taking sides in the leadership contest, but he made clear that there could be no going back on the legislation.
"On equal marriage, I am extremely proud of it. So many people have taken advantage of it. I think there is now an enormous parliamentary majority for equal marriage and so I am confident that it will continue to be the case," he said.
"It is also being copied all over the world. Britain was one of the countries with a centre right leaning government to take that step and many others are following suit and I am very proud of that."
Andrea Leadsom has previously spoken openly about her faith stating "I always try to ensure that I'm doing what I think God would want me to do".