TONY JONES, PRESENTER: Long-simmering tensions within the Coalition bubbled to the surface in a dramatic fashion today, ending with the resignation of a key Tony Abbott ally.

Senator Cory Bernardi was Mr Abbott's parliamentary secretary and a long-term political enemy of Malcolm Turnbull, but will leave the shadow ministry after making inflammatory comments during the same-sex marriage debate.

The resignation came as Parliament comprehensively voted against allowing same-sex couples to wed.

Political correspondent Tom Iggulden reports from Canberra.

TOM IGGULDEN, REPORTER: Cory Bernardi's never been backward in coming forward, and so it was with his contribution to the gay marriage debate. The South Australian senator wondered where allowing same-sex marriages would lead.

CORY BERNARDI, LIBERAL SENATOR (Last night): There are even some creepy people out there who say that, you know, it's OK to have consensual sexual relations between humans and animals. And, you know, will that be a future step? Will that be one of the things that say, well, you know, these two creatures love each other, maybe they should be able to join in a union?

TOM IGGULDEN: This morning the senator doubled down when he tried to explain his comments, gate-crashing a radio interview with South Australian Liberal colleague Christopher Pyne.

CORY BERNARDI (on ABC Radio 891): We have people like Peter Singer, who was a founder of the Greens and wrote a book about the Greens, that have actually been endorsing consensual unions between man and beast or women and animals. If we're going to redefine marriage, which I don't support, well, you know, there will always be another call to include a broader system and I don't know where it will end.

TOM IGGULDEN: There was outrage about the comments from Mr Bernardi's political enemies, including one from inside his own party.

MALCOLM TURNBULL, SHADOW COMMUNICATIONS SPOKESMAN: Because they are bizarre, they're extremely offensive, they're wrong and I don't want people to think that they represent the views of the Liberal Party and they certainly don't represent the views of this Liberal Party MP.

TOM IGGULDEN: Mr Turnbull supports gay marriage, but that's not his only difference of opinion with his colleague.

CORY BERNARDI (2009): Well, Malcolm Turnbull has advised me that I've been relieved of my duties as shadow parliamentary secretary.

TOM IGGULDEN: As Opposition Leader Mr Turnbull sacked Mr Bernardi from his first stint in the ministry after he publicly accused Mr Pyne of once considering joining the Labor Party.

CORY BERNARDI (2009): I regret any damage its done to the Liberal Party, of course.

TOM IGGULDEN: Months later, Mr Bernardi was a key member of the right faction that rolled Mr Turnbull and installed Mr Abbott as Opposition Leader.

Today was a chance at revenge.

MALCOLM TURNBULL: I'm not going to give Tony advice publicly. I'm not gonna run a commentary on Tony's - you know, what Tony should or shouldn't do.

TOM IGGULDEN: In the event, Senator Bernardi fell on his sword.

TONY ABBOTT, OPPOSITION LEADER: Senator Bernardi's resignation has given me the chance to make a strong team stronger.

TOM IGGULDEN: Two former John Howard advisors, Jamie Briggs and Arthur Sinodinos, have been promoted to take over Senator Bernardi's duties amid questions about his future.

JOURNALIST: How many times do you need to be sacked to be disendorsed?

TONY ABBOTT: Well these are matters for the lay party. Cory is a talented politician with much to contribute, but plainly he has been guilty of ill-discipline, lack of judgement and he'll have to do a fair bit of political penance, no doubt about that.

ANTHONY ALBANESE, TRANSPORT MINISTER: He just doesn't get it. He just doesn't get the need for respect. Mr Abbott has said that these comments were ill-disciplined. That's not the point. The point is they were bigoted comments.

TOM IGGULDEN: If Senator Bernardi was hoping to influence the vote with his comments, he needn't have bothered. When the gay marriage bill came to a vote this morning in the House of Representatives, fewer than a third of MPs voted in favour.

SPEAKER: 42-98. You won; they lost - OK?

SHELLEY ARGENT, MARRIAGE EQUALITY ADVOCATE: I think this government, the whole of the Parliament that voted against this should just be ashamed.

TOM IGGULDEN: But the controversy over Senator Bernardi's comments did overshadow the continuing parliamentary battle over the economy on a day when the Standard & Poor's rating agency reaffirmed Australia's triple A rating. But the Opposition found one skerrick of bad news in the agency's analysis.

JOE HOCKEY, SHADOW TREASURER: Standard & Poor's says Australia heading for a $20 billion-plus deficit. Just come out. $20 billion-plus deficit.

WAYNE SWAN, TREASURER: They have confirmed that it is our strong fiscal discipline which has underpinned, underpinned their rating. They have pointed to our low public debt.

TONY ABBOTT: With revenues falling and now with a damning Standard & Poor's report, does the Prime Minister still claim that the Government is on track to deliver a budget surplus this financial year?

JULIA GILLARD, PRIME MINISTER: No amount of bellowing from the Opposition is going to turn a triple A credit rating from Standard & Poor's into anything else. So the premise of the Leader of the Opposition's question is absurd.

TOM IGGULDEN: And tonight Standard & Poor's has clarified with the ABC that its $20 billion deficit it was talking about referred to last year's budget and that it still expects this year's budget to return to surplus.

Tom Iggulden, Lateline.