Landlords do provide services: property maintenance and not having to worry about selling the place when you leave. Are landlords paid way too much for these services? Hell yes. That’s more an issue of inadequate supply though, in my opinion.
Similarly, ticket scalpers provide a service, but not to concert goers. Scalpers absorb risk on behalf of the venue/performer. That’s why venues, who could absolutely shut down scalpers, don’t. Still scummy as hell, but don’t absolve the venue of guilt too.
If there were more available units, you could leave and go to one with better maintenance. There’d be actual competition between landlords to keep tenants.
Not ideal, obviously, since moving is a pretty big life event. I’m not saying increasing supply is the solution to every problem with landlords. Being allowed to withhold partial rent if common elements are broken would probably be a better solution in this particular instance.