Going on the assumption that most of them are in Edinburgh (which is the only sample I can really draw from personal/anecdotal experience from friends/relatives) it's likely down to cost and legislation. Might have been a bit facetious with saying it was all of Scotland
I'm legally not allowed to change my windows out for anything that
isn't sash, something to do with ruining the historic aesthetic of my area, for example. Obviously the council isn't going to subsidize that, though, and sash is markedly more expensive than standard PVC double-glazed regular windows. I'm not willing to pay for that, either. The neighbours in 3A/B are both students and have a similar situation: the landlord (who also lives in the building, actually) is refusing to replace the windows for them, despite both of them being on the ground floor facing the street and burglary being a cause of concern... that's an example of the legislation (partly) causing an issue, at least where I am. Those second-years have no luck in paying for it though :lol
The landlord is actually a decent guy I have to add: he doesn't overcharge on rent or anything and responds to all the other problems that lot have. Just have to throw that in (he also has a really cute cat!
)
As for cost... removing an old lead tank, stripping out all the lead pipes... not exactly very easy. It's a lot easier to tell your tenants "Don't drink the water in the bathroom and only use the cold water in the kitchen, unless you want to get lead poisoning" than spend £8,000 (my quote just for the plumbing...) doing all the work. In my time fishing for apartments around Edinburgh for 2nd year, almost every tenement I visited had the same conditions: old lead water tanks, atrocious interior quality, and horrific energy ratings. Some of the flats actually had mains for everything, but because removing the tank (after draining it and simply throwing in a boiler instead of the immersion heater, and a mains hook-up to the bathroom) was uneconomical, it had been left there to occupy space and contribute nothing but dead weight. It's honestly ridiculous!
All that being said, HMO's are still a decent option. They're not allowed to have the whole lead-pipe situation and actually have standards to conform to. If you're with friends and renting a place from a landlord which has the place HMO licensed, you're fine (though they do often charge extortionate costs to students, because students.)
If it were a legal requirement that all such problems were rectified (see: modern energy/plumbing/electricity standards, even for old buildings) and grants were provided to do this where the owner wasn't able to afford such an effort (see: the poor) I really do think Scotland would be a much better place to live, though I can't see that happening any time soon, sadly. It'd be pretty cool to see a case where such grants were provided without means testing, but instead as some form of loan, where repayment would occur automatically to the Gov't once a sale were carried out on the property (in which case the Gov't would get back any of their losses in providing their loan, possibly with a % increase or decrease based on the valuation of the property, something like that!)