The figleaf argument was that local authorities did not have the money to do the needed repairs, let alone upgrade to modern standards for the thousands and thousands of council owned properties.
However, sell them off to the tenants at a significant discount and those tenants will a) be able to afford to buy making them pathetically grateful to the Tory government that allowed them to do so and b) also be able to fund the repairs needed for their one property.
For quite a lot of people it did work that way. There are still quite a few former council properties being lived in and looked after by the people who bought them under right-to-buy.
Even if they sell them off rather than living in them, it transfers a moribund bit of housing stock away from the local authority (for whom it would, by this analysis, be only a drain on resources) to the private sector - hurrah! - and given the significant discount mentioned above there would be more than enough resources to do the work.
Whether a slum-landlord type would do the work is another question - but there at least the local authority has some ability (to some degree more in theory than in practice) to require the owner to do works.
Did I mention the significant discount?
https://righttobuy.gov.uk/what-discount-could-you-get/
That calculator also slightly undersells the discount because it talks about ‘market value’ but doesn’t point out that ‘market value’ in this case means as assessed by the local authorities surveyors department rather than the usual sharp suited spiv estate agents who actually sell properties. It is therefore usually significantly lower than what an estate agent would call ‘market value’.
Add on the up to 70% discount and a tenant can usually find someone to lend them the money no matter how terrible their credit rating even if only on the basis that it will be sold off immediately (often to the lender or a tame property developer).
Lenders will often lend significantly more than the required purchase price for right to buy properties - often pushing such loans on council tenants with phrases like “You’ll be able to replace the kitchen and the bathroom, get new carpets, double-glazing, etc…”.
Buy a £300,000 flat for say £175,000, spend maybe £20,000 doing it up (if that), sell for £350,000 (because the market has risen in the meantime), makes for a nice profit.
It’s hardly surprising that many former tenants sell.
That this has the effect of breaking up tight-knit, often Labour voting areas, instilling a nice sense of gratitude to the Tory party for the lucky punters, keeping the housing market moving and thereby the UK economy going and propping up house prices for those already Tory voting people who read the Daily Mail and worry constantly about their house price falling is mere happy chance.