IT was never entirely clear whether Alex Salmond's apparent infatuation with Her Majesty the Queen was genuine or merely theatrical. The former First Minister and Mrs Windsor certainly seemed to get on suspiciously well, perhaps because of a shared love of horses.

But did he really believe that she was “Queen of Scots” – a legitimate and enduring institution to be retained after independence? Or was he just making nice in order to reassure middle class Scots that the SNP weren't republican revolutionaries?

The SNP has never been a wholly republican party, of course, though there has always been a strong strand of opposition to hereditary monarchy. Until 2002, party policy was to hold a referendum to resolve the issue after independence. A number of prominent nationalists such as the Scottish Environment Secretary, Roseanna Cunningham (aka “Republican Rose”), continued to voice principled opposition to the institution even as the party gradually became explicitly monarchist. The 2013 independence White Paper simply asserted that Scotland would remain “a constitutional monarchy” and that, as far as the Scottish government was concerned, the Queen would remain head of state and Scots would continue to pay for her upkeep through their taxes.

Nicola Sturgeon has bent the knee, quite literally, to the Queen and insisted that the Scottish Government has no plans to change the status quo. As so often with the SNP, the party has shed a radical policy position without any debate, relying on the membership's reluctance to challenge, or even debate policy to allow the leadership to choose whatever happens to suit them at any particular moment. As used to be said about the Conservative Party, SNP policy on monarchy has just “evolved” . Until now. For there is a distinctly republican theme running through the race for deputy leadership of the SNP.

As The Herald has reported, Alyn Smith, the prominent MEP and deputy leadership candidate, has revived the call for a referendum to decide the head of state after independence. His rival, the Edinburgh East MP Tommy Sheppard, is a republican of long standing who could never support retaining the monarchy in Scotland after independence. Chris McEleny, the Inverclyde council group leader whose hat has also landed in the deputy leadership ring, is also opposed to an hereditary head of state and has made his views clear on social media. This leaves only the Westminster leader, Angus Robertson, as the keeper of the royal flame in this contest.

You couldn't exactly call it a republican movement in the SNP: Smith says there are some monarchies that he supports and Sheppard doesn't think the issue should “get in the way” of independence. But the republican character of this contest is a reflection of discontent within the party at the direction that it has been taking on the constitution and other issues. The SNP shouldn't become monarchist by default.

There is something perverse in the party of independence wishing to retain an institution which is the very linchpin of the British Establishment. The Queen is the fount of the undemocratic and unwritten constitution, and of the unelected House of Lords which shamefully remains a part of the legislative system. The prime minister in Westminster still exercises the sovereign powers of the Queen in parliament, most notably the royal prerogative which, in theory at least, allows the PM to declare war without consulting parliament.

The Queen is also the apex of the deeply corrupt and regressive honours system, which has been used by successive prime ministers to reward cronies and party donors. It has come under sustained criticism again this week following David Cameron’s resignation honours list. The Queen is as unionist as the Union flag so why is the Scottish National Party celebrating this remnant of the British Empire?

During the independence referendum campaign two years ago, retaining the monarchy was one of the issues that caused most disquiet within the wider independence movement, along with keeping the pound and membership of Nato. Yes supporters like Common Weal and the Radical Independence Campaign made no secret of their frustration with the SNP's plans to keep the Queen. The republican chair of the Yes Scotland campaign, Dennis Canavan, demanded a referendum on monarchy, as did the former SNP justice minister Kenny MacAskill.

But Alex Salmond's approach was to let sleeping royal dogs lie. The British monarchy, he insisted, is a thoroughly constitutional one – meaning that the Queen doesn't actually rule in any legislative sense and is always subject to the will of parliament. She is therefore a piece of constitutional ornamentation, useful for entertaining foreign dignitaries and acting as a symbol of whatever being British still means to the world – a bit like a commercial brand.

Moreover, for Salmond the Queen did not actually represent the United Kingdom that Scotland wished to leave: the political union established by the Treaty and Acts of Union in 1707. She is queen of Scotland, ultimately, because of the 1603 Union of the Crowns, when James V1 of Scotland became James 1st of England (albeit that the line took a diversion via Hanover). When Salmond said that Scots could still call themselves “British” after independence he meant that they could regard themselves as part of a Britain that predated the loss of Scotland's parliament and economic autonomy in 1707.

Of course, many suspected that the real reason for Salmond's support for the Queen was political expediency – maximising the independence vote, creating the biggest possible Yes tent. Many older Scots retain an emotional regard for the monarchy, especially those who have military connections. The war and all that. Proclaiming that the Queen would remain after independence also wrong-footed the UK tabloid newspapers, and made Scottish nationalism seem less threatening.

Most SNP supporters went along with Salmond on the grounds that the monarchy doesn't really matter so why bother to abolish it. The Queen seems a decent enough old lady and spoke well at the opening of the Scottish Parliament. Prince Charles wears the kilt, and every year the Royal Family decamp to Balmoral to watch Highland games wrapped in deep layers of tartan to ward off the cold and the midges.

But the fact that the royals are fond of Sir Walter Scott and castles is really not a very coherent reason for nationalists to retain, post independence, an institution that has been so central to the Union. It just isn't on for an independent Scotland to have a head of state who is only in post “because of the bed she was born in”, as Chris McEleny has put it.

Before any future independence referendum, the SNP must draft a proper constitution for an independent Scotland. It would be an absurdity if that constitution were to be led by a head of state selected by accident of birth. It is time the party set aside political theatre and accepted the overwhelming case for abolishing this anachronistic relic of feudalism. The SNP should stop playing patsy with the Queen and make clear that any future head of state of an independent Scotland will be elected by the people of Scotland. Her Majesty is welcome to stand if she fancies her chances.