Sir Anthony Seldon, author of 'Cameron at 10' said that the Prime Minister defied opposition from within his own party to push through the vote in 2013.
Mr Seldon described the atmosphere at the 2011 conference, where Cameron made the announcement, with the sentence: "a bomb detonates in the party," according to The Mail Online.
He stressed that there was not another issue as divisive in the party and said some saw it as "authentic Cameron" pushing through his ideals, whereas others described it as a "self-inflicted wound".
The author also added that Cameron had thought about including it in the 2010 manifesto, but was over-ruled by Andy Coulson, the press advisor.
The conversation between him and advisors is reported to have gone along the lines of advisors suggesting it was pointless and not going to win votes, and Cameron replying: "Unless you are making some Neanderthal judgement on gays, those who are gay should have the same rights as those who are not."
Lynton Crosby, part of Cameron's election team, is thought to have supported the policy but also warned that it could cause a distraction.
Whereas Liam Fox, Former Cabinet Minister is also thought to have dismissed same-sex marriage as "the victory of liberal dinner party metropolitan thought over the wider party."
Speaking at the time of the vote on same-sex marriage in May 2013, Cameron said: "Of course the gay marriage issue has been divisive and I totally respect those who take a different opinion.
"I don't think in any way that to oppose gay marriage is to be wrong-headed or bigoted. This is a different point of view but we should respect each other."
Overall 136 Tory MPs opposed the policy in the Commons, but it passed into law by 366 votes to 161.
Mr Seldon also revealed Cameron and Putin had debated the issue at the 2013 G20 summit to discuss Syria in St Petersburg, saying "Cameron is riding a high horse, using arguments fresh from his jousting on gay marriage back home, while Putin argues that Russia's future demography will have problems if gay people are allowed to marry each other and that the country will not have enough children to secure its future."
He said the debate moved from anger to joy and back again: "They are acting like executives at a sales conference who have stayed up too late at the bar.
"Aides on both sides just wish they'd shut up so they can all go to bed, amazed that they are still taking so late into the night in the midst of such an important international event."