Scotland doesn’t have a deficit. It is, in law, obliged to balance its books. That is why it always ends the financial year with a very small surplus which unionists then make a song and dance about because they allege that that money is being withheld from the public. Any deficit is that of the UK, not Scotland.
It is normal and appropriate for countries to have a deficit. A country’s national deficit is equal to the surplus of private individuals and companies. If a country runs a national surplus that means that the private sector (you and me) go into debt. That is the inevitable result of all these years of tory austerity. See Professor Richard Murphy here for example:
Other sensible economists to listen to are Professors Stephanie Kelton, Bill Keen and Bill Mitchell. There are others.
Of course the money which is spent by government and which goes to creating the national (UK) deficit, may well be inappropriately spent on fantasy projects such as HS2, Hinkley nuclear power station, refurbishing the Houses of Parliament, refurbishing Buckingham Palace, Trident, etc. etc. So a country can run a deficit created by bad spending decisions. But that does not mean that a national deficit is a bad thing per se