Primarily because we are less affected by immigration therefore its not seen as a problem. I guess other big reasons include the fact that lots of infrastructure - major roads in the Highlands for example - receive funding from the EU rather than from Westminster. I think about 20% of the population (1 million or so out of the 5.2 million) lives rurally too so benefits from farming subsidies and and other funding for rural communities leads to support for the EU.
I would imagine racist sentiment to be far less because we have fewer ethnic minorities and therefore less reason to feel threatened by other cultures, which is often the underlying reason for racism. I would also say Scottish patriotism is generally seen in a different light to English patriotism - English patriotism is unfortunately more associated with football thugs, but because our national teams aren't much good our thugs don't get the chance to give us such a bad rep, instead our patriotism is seen as men in kilts doing the highland fling while drinking irn bru or whisky and eating haggis.