It's interesting. As far as I am aware, those testing positive would be based on home address so care home density would add to the figures but as most people in hospital have a home address, that shouldn't make any difference.
There isn't as big a size difference between Edinburgh City and Glasgow city as you'd think, the difference is that Greater Glasgow area is far larger in size and population than the Lothians.
Although poverty is mentioned a lot, when you look at the local breakdown in Edinburgh then there was a real mix of poorer areas and more affluent featuring in the those with the highest rates. I'm not as familiar with Glasgow (and it's all mostly red) so I can't really say if that is a feature there or not.
It could even be a case of just higher levels of testing which grows and grows as contact tracing kicks in and more go for a test with very little symptoms, then it just explodes. Levels could be broadly similar in any of the more populated areas to be honest but areas that are tested more will have more positive cases.
Lifestyle factors no doubt affect the amount requiring hospitalisation in the same way as life expectancy in general is lower in areas where obviously poverty plays a big part in general health. It needs to be remembered that the average age of death of someone which has ben attributed to covid is higher than the average age of death. That's not to say that everyone dying isn't important or greatly missed, but lots of people lose their lives every day and many of them at a much younger age and many of them directly related to the lock down and restrictions rather than covid.