Weird Al, there are a few things that may have put some pressure on Ernie.
First, there’s been some slippage in support for gay marriage in some of the recent polls; can’t find any just now, but I believe it may have gone from ~53% in favour to ~ 45% in favour.
Second, the support for gay marriage is consistently shown to be strongest in the under 40 crowd, and opposition strongest in the over 40s. Nor is it disributed evenly regionally - support tends to be stronger in urban areas, opposition stronger in rural areas.
Third, the Roman Catholic church has weighed in, calling on its adherent to oppose gay marriage, and saying that it’s a mortal sin for Roman Catholic politicians to vote in favour of it. The Bishop of Calgary went so far as to say that Jean Chrétien is in danger of going to hell for his position. Ernie’s apparently Anglican, so that shouldn’t bother him, but it may have an effect on his party’s supporters who are Roman Catholic.
Fourth, (and we’re starting to get to why some may see Ernie’s flip-flop as pure politics), his party is the Progressive Conservative party of Ontario, which is a right-of-centre party. They’re about 15% behind in the polls, but the election may be closely-fought in some ridings, where every vote may count. One of our Ontario posters may be able to provide more detail, but it’s my understanding that the Tories in Ontario tend to be stronger in the country than in the urban areas. As well, traditionally the Tories have appealed to the older demographic of voters. In a closely-fought election, you need to have the troops to do the grunt work of campaigning at the local level. Past experience has shown that if you alienate them, they may not turn out to work on the campaign, drastically affecting your ability to get out the vote. Really alienate the hard-core supporters, and they might stay home themselves on election day
Overall, there’s some reason to speculate that Ernie has calculated that the hard-core of his support will oppose gay marriage, and that he needs to oppose it to keep them happy. He may have calculated as well that those who support gay marriage strongly weren’t likely to vote for his party anyway, so his flip-flop won’t have much negative effect for him and the party.