Both the top rated answers here reject the premise of the question that The Marriage (Same Sex Couples) Act 2013 was "pushed" through by David Cameron. While the total votes for the Bill were 400 to 175, which suggests a strong majority in favor it is worth noting the under the UK system the government controls the agenda, and given the strong position of the conservative party in the 2010-2015 coalition, that means the Conservative Party at the time the Bill was passed.
The breakdown of the vote can be seen here on wikipedia. And while there there is an overall parliamentary majority for the bill, the Conservative Party vote 126 to 134 against The Marriage (Same Sex Couples) Act 2013, so in that sense the Bill was pushed against the wishes of the majority of the party with defacto control of the political agenda.
Unfortunately for this as an answer, it's not clear to me why David Cameron decided to go ahead with this legislation against the majority of his MPs and I haven't been able to find any primary sources regarding his reasoning. The most likely reason is because popular opinion in the UK strongly favoured it at the time. Wiki-Opinion. According to the linked article support for Gay Marriage had grown from 52% in 2004 rising to 71% in 2012. Although the linked article makes clear these numbers swung wildly depending on the exact wording of the question, as polls only a couple of months apart generate quite different numbers, though almost always with a majority in favour.
In summary, David Cameron pushed the legislation for equal gay marriage through against the opposition of his own party, but with general parliamentary and UK wide popular support, most likely because he agreed with the mood of the country that it was the right thing to do.