Nicola Sturgeon's decision to forswear political opportunism and campaign for remaining in the European Union has been vindicated by the horror show taking place south of the border. Never has the gulf in political culture between Scotland and England been so wide as in the past week, as the row over immigration overwhelmed the EU debate – complete with overtly racist imagery in the infamous Brexit poster.

And lest anyone claim this is in itself a racialist comment on the character of English people let me say right away there is nothing in the Scots' DNA that immunises them from racial intolerance. Indeed, there is evidence the very absence of black and brown faces in Scotland has led to some prejudicial sentiments going unchallenged in the past. No – it is not the English are different, it is that Scottish politics and history are different.

Racism and immigration are not part of the political equation here. This was demonstrated by the conduct of the Scottish independence referendum which, by common agreement, really was a festival of democracy compared with the EU referendum campaign. There have been attempts by some of the creepier elements in the commentariat and some London broadcasters to equate the two, of course. The Scottish referendum was all about “narrow nationalism” just like Brexit. They were both riven by “ugliness and hate” weren't they?

Well, no they manifestly were not. The Scottish independence referendum never once threatened to descend into the politics of immigration and fear. Not even the most primitive SNP supporter would have dreamed up a poster with lines of English people threatening Scotland’s borders. The indyref was never about racial or cultural exceptionalism, except in the minds of some unionist propagandists.

The Yes Scotland campaign was about internationalism and social justice – about making a break with the irremediably reactionary character of Westminster politics. The various organisations that supported the Yes campaign – Women for Independence, the Radical Independence Campaign , the National Collective etc – were all dedicated opponents of racialism in all its forms and would never have tolerated any kind of anti-English nastiness.

Compare and contrast. The UK Leave campaign as a whole, and not just Ukip, has turned the EU referendum into a plebiscite on immigration, summed up by that thumping soundbite about ”taking control of our borders”. It is all about holding off the “500 million EU passport holders” and the “million Turkish migrants” many of whom, it is hinted, are criminals. Brexit is overwhelmingly a project of the political right, not the left.

There is a reason why Scotland has provided sanctuary to nearly a third of Syrian refugees. And it is to do with history and politics. Scotland may have participated in the British Empire, but very much as a junior partner. And the experience of empire was principally that of emigration as Scots populated half the planet. A nation of migrants is less likely to fear or resent migrants of a different nationality.

But it's not just Empire, but what happened after it that accounts for the different approach to race. Scotland adopted with enthusiasm the post-war settlement including the welfare state, the NHS, nationalised industries and the social democratic ethos of the times. It retained a commitment to those values long after Margaret Thatcher started to dismantle these institutions. A more social democratic outlook does not necessarily imply a greater tolerance of immigration, but it does mean that Scots tend to look to unequal distribution of wealth to account for their misfortunes rather than the presence amongst them of black faces. The 2014 referendum was a celebration of those essentially social democratic values.

There is also the contingent economic imperative. Because Scotland has long suffered from out migration, the population here is ageing more rapidly than in England. We a need to attract workers paying taxes to make the economy function, especially under the fiscal framework. This can either come from faster economic growth, or from immigration or both.

England needs migrants too and the fact this is not recognised is a tragic product of history, but is now central to politics there. Whatever you think of the SNP, it is not a racist party and the independence movement is not defined by immigration. So let's hear no more of these sly attempts to equate the nationalism of Nigel Farage with the nationalism of Ms Sturgeon – it really is chalk and cheese.