As a former landlord I want to point out that some landlords are very conscientious.
I made a point of ensuring my tenants were provided with high-quality accommodation in a safe environment. The Scottish legislation required this, and personally I wanted to make sure the tenants were as safe as my own family, and some. Yes, it costs money to keep properties in top condition, to have the electrics checked and appliances tested, proper smoke alarms etc. but given all these costs amount to less than a month's rent and is deductible for tax, there is no excuse except greed.
I also represented other landlords, and if they could not produce the required EPC, electrical certificate, gas certificate, ISITEE and Legionella Assessment, plus proof of registration with the Local Authority, I declined their business. Sadly, with the availability of valid tenancy agreements online, some unscrupulous landlords take advantage of the tenants who are not aware of the regulations and are desperate to find a home, thus can skirt round the rules, pocket the rent and ignore their responsibilities, whilst producing valid leases. Recently, government legislation has meant that many resposible landlords have left the marketplace, so that the cowboys have cashed in on rental portfolios, and continue to exploit the vulnerable. Had those tax changes and others not been made law, the good guys would have continued to provide excellent homes. I've said enough...