Posie, the UK - Scotland, England, Wales, Northern Ireland and lots of islands - is an EU member. As such, we must extend to other EU members the same privileges that we extend to ourselves.
However, Scotland is a region within the EU, as is England (and Wales etc).
It's legal to discriminate in favour of your own regional citizens.
Scotland has, and has always had, a separate education system.
(Also separate legal and Church set up. It was guaranteed in the Acts of Union.)
So, we have to accept EU students on the same basis as our own.
But we don't have to accept other regions from within the UK the same.