The law is the law. If a landlord doesn't like the law, they don't have to be a landlord.
As someone who used to work at a tax certiorari firm, I can tell you there's just as much fucking over between the landlords and city/state tax money. Landlords are making money for not doing a whole lot except owning land. New York landlords make a killing. I've seen their returns. There are landlords who leave large portions of or entire buildings vacant _on purpose_.
If you really want to go down that rabbit hole, we can talk about how land ownership and the tax structure is a massive wealth extraction from the lower classes.
Actually, to more directly respond to your comment:
So when you have problems with your wiring that your landlord refuses to fix (that are required to be fixed by housing regs) you have two options: a) complain and wait months/years for action or b) fix it yourself out of pocket.
You choose option b and then the landlord raises your rent. You don't think that's getting fucked over? You think tenants should put up with shitty (below required) conditions just because the rent is cheap (as regulated by law)?