Not so long ago Alex Salmond was considered a political genius. He outmanoeuvred his Westminster opponents at every turn, ran rings around the vestiges of talent in Hollyrood and struck the right balance of cheery bonhomie and statesmanlike vision in his TV appearances.

He straddled left and right – courting Rupert Murdoch while pledging a social democrat Scotland – and proposed radical changes while appearing reasonable and good-humoured. He was really, really good at his job.

But yesterday's clumsy attempt to politicise Andy Murray's Wimbledon win showed the wheels coming off the Salmond bandwagon. BBC cameras cut away just as he and his wife were unfurling a large Saltire behind David Cameron's head, amid crowds cheering the historic victory. It would have looked bad if the cameras caught him waving it, but by showing just his frantic efforts to get the flag out, it came across as particularly amateurish.

As Salmond insisted today, he had no control over the seating arrangements, so it wasn't a purposeful effort to photobomb the prime minister. Nevertheless, the short clip made Salmond look cheap, childish and, as Labour MP Tom Harris put it, 'naff'. It had a hint of the John-Terry-celebrating-in-his-kit meme. It looked desperate.

The Scottish first minister has reiterated – with an ease which sounds like it's been well rehearsed – that the flag was being flown far and wide, not least above Downing Street. It's true, but an act become political not just by virtue of what it constitutes, but also because of who does it and why. Salmond waving a large Scottish flag as Murray wins is clearly a political statement.

It is one he was unwise to make. There are political gains to be made out of sporting events, but politicians are the worst-placed people to secure them.

Major sporting events often act as conscious or subconscious parables of national virility. It is quite easy for them to become political, or at least have political effects.

There is a myth that England's 1966 World Cup victory helped Harold Wilson into No 10. It is a myth which would be more convincing if the tournament happened before the general election, but alas it did not, even if Wilson absolutely milked it for all it was worth. However, England falling out of the Mexico World Cup at the quarter-final stage in 1970 may have had some impact on voters' surprising decision to get rid of Wilson and put their faith in Edward Heath.

All of which goes to show how sporting events' political ramifications will be felt, or not felt, despite the efforts of politicians.There is no sense in a politician, even one of Salmond's abilities, trying to stir up a zeitgeist. They should instead wait on the sidelines and hope the sentiment heads their way. Trying to contribute to it achieves precisely the opposite of what they intend.

The attempted politicisation of a sporting victory shows the politician to be scheming and cynical. It suggests that far from being overcome by group euphoria, he is interested only in his own advancement. Sensible politicians wouldn't even attend sporting events, let alone try and hog the limelight.

Salmond should know better. He was left with egg on his face last summer, when his desperate attempt for Scots to celebrate only the accomplishment of 'Scolympians' was left looking mean-spirited and divisive amid a sun-kissed fortnight of national euphoria.

The feeling of the Olympics will be mostly forgotten by the time Scotland goes to the polls next year, but that celebration of British achievement showed how comfortable so many people still are with the Union Jack. It was a testament to an abiding sense of British identity which Salmond's separatist politics cannot quite drown out.

The Murray victory should, if anything, be a boost to the Scottish first minister. While most of the talk – including that from Murray himself – has been of the importance of a British winner in a British sporting event, it cements the impression of Scotland being a country of weight, a country which could still pack its punches on the world stage even if it was detached from its larger neighbour.

Of course, using an extremely talented local lad as evidence of national economic and political strength is absurd, but people think this way.

The temptation was too much for Salmond to bear, so he packed a flag in his wife's handbag and whipped it out when the moment came. The move backfired, as it was bound to.

Next year will see the Commonwealth Games in Glasgow, in which Team GB will be split into its four composite countries. Salmond, who will be well aware of the polls showing the referendum vote slipping out of his grasp, will be desperate to use the event for political advantage.

Given his experience at the Olympics and Wimbledon, he would be well advised to ignore the temptation.

The opinions in politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners.