DAVID Cameron achieved something unique last week: he will go down in history as the first British prime minister ever to be defeated in Parliament on a motion about going to war.

Commentators are saying that his administration is fatally damaged as a result; that a prime minister who cannot get his foreign policy through the House of Commons is a prime minister who is in office but not in power. Comparisons have been made with Suez in 1956, when the Conservative prime minister, Anthony Eden, was destroyed by an abortive invasion of Egypt.

But we are surely missing the point here. Last week's vote may have looked like a defeat for a political leader, but it was actually a victory for parliamentary democracy. Indeed, it has arguably altered the British constitution because, in the past, prime ministers didn't have to win votes in Parliament before going to war. Something called Royal Prerogative gave them the right to launch military action without consulting anyone, let alone holding a vote on it.

Royal Prerogative is one of those anachronistic hangovers from the age of absolute monarchy, like the House of Lords and the honours system, that used to define British constitutional practice. Prime ministers are kings when it comes to war-making and, strictly speaking, votes like last week's are only advisory. Cameron could have ignored it and carried on with the missile strike and parliament would not have been able to do anything about it. So why didn't he?

Well, in short, because prime ministers have been cut down to size. The political consequences of carrying on regardless were too dire to contemplate given the state of public opinion - which is against a war - and the balance of forces in the Commons. Cameron would have been cast as a dictator, riding roughshod over Parliament and the will of the people. The press would have savaged him, and his Coalition partners, the Liberal Democrats, would probably have withdrawn their support from his government. He might have found himself fighting not a war in Syria, but a General Election in Britain.

In Scotland, we are rather more accustomed to this kind of politics because the Scottish Parliament is a proportional parliament - or is supposed to be - in which no one party is meant to have an overall majority. Yes, I know that Alex Salmond succeeded in winning an outright majority in 2011. But that is the exception to the rule. Holyrood was designed to be a consensual legislature where headstrong leaders could not expect to get their way. There has to be argument and counter-argument, give and take, a recognition that no one leader is infallible.

In 2003, Westminster was what is often called an "elective dictatorship". Tony Blair had such a huge majority that he was able to defy the biggest backbench rebellion in Labour history and drag Britain into a disastrous war in Iraq on the basis of a false prospectus. David Cameron could not do that as his party does not have an overall majority - and nor could he fall back on his pre-democratic prerogative powers. So, finally, democracy came to Westminster.

Actually, Cameron made a fairly decent fist of it, conceding that Parliament and the country were not behind him and accepting defeat with a degree of good grace. "Parliament spoke," he said, "and I have listened."

At least he didn't stomp around making threats and accusing his backbenchers and Labour of "giving succour to the enemy", as some of his more over-wrought advisers and colleagues did. The Education Secretary, Michael Gove, went ballistic, accusing Conservative backbenchers of "disgraceful disloyalty".

Where Cameron can be criticised is in the intellectual case he presented: it simply didn't stack up. He gave no adequate explanation of why it was necessary to launch a military strike against the Syrian regime before the United Nations weapons inspectors had reported. Nor did his presentation of the intelligence on who was responsible for the Damascus atrocity carry conviction. He conceded that it was a "judgment call" and no-one could be sure that President Bashar al-Assad had authorised a chemical attack on his own people.

But the principal reason it did not convince was because Cameron seemed unable to explain what the strike was supposed to achieve, other than in some vague sense "deter" Assad from using chemical weapons in the future. But would hurling a few cruise missiles at Syrian military bases really prevent further atrocities in this terrible civil war? If Assad was mad enough to gas his own people, in an area he already largely controlled and on the day weapons inspectors arrived in his country, surely he was mad enough to defy US President Barack Obama's "shot across the bows" and up the ante. This is a civil war replete with atrocities, quite apart from the use of chemical weapons. Where do you draw the line?

Of course, Cameron's people were keen to cite the success of allied military intervention in Libya against the undoubtedly unbalanced Colonel Muammar al-Gaddafi two years ago. But Libya was different. There, Gaddafi was preparing to send his tanks into the rebel-held city of Benghazi, and there was a likelihood - indeed, a certainty - that many civilians would be massacred as the city was systematically destroyed. Outside intervention came with a very clear objective: prevent an imminent humanitarian disaster, which could be achieved with a time-limited engagement. British and French planes were able to identify and destroy Gaddafi's military convoys as they trundled over the desert.

Syria is a much more difficult nut to crack. The forces are more evenly balanced, and specific targets are less easy to identify than tanks in the sand. Moreover, since militant Islamists associated with al-Qaeda are fighting on the rebel side, it is not entirely clear who the good guys are. Russia and China evidently believe Assad is the lesser evil, and while they may be wrong in that, it is at least an issue to be argued over in the United Nations. When Ban Ki-moon, the UN Secretary-General, called on all sides to "give peace a chance", he pitted Cameron against The Beatles. No contest.

So, as Alex Salmond rightly said, the case for intervention was not made. The First Minister can take some satisfaction in having strengthened the case for caution - though cynics might argue that an unpopular war launched by a Tory-led government in Westminster was just what the faltering Yes Scotland campaign needs right now.

It was the Iraq war that persuaded many prominent Scots, including the late novelist Iain Banks, of the case for independence. But at least Salmond was on the right side, and showed that the office of First Minister can be used to make moral interventions in areas where the Scottish Parliament has no legislative responsibility.

Of course, Salmond said that only with independence could Scots be sure they would not be dragged into illegal wars. Unionists will respond that, on the contrary, Westminster is the best place to decide matters of war and peace.

The argument will go on. But at least we now know that when the UK Parliament, and the UK people, are not convinced of going to war, then a headstrong prime minister is not going to defy them. We should thank Cameron for making that clear.