This is just handwaving voodo - we expect better on hackernews.
Reality is landlords are in all different situations, some have spare money above costs of interest, rates, insurances, rental agent fees, etc etc and can use that to pay for maintenance. Many are putting in their own money to pay for maintenance, the same way they put in their own money to afford the deposit and purchase costs.
And when there's a problem a landlord can't just ring the first inflate-a-quote contractor and open up the unlimited checkbook you seem to be ascribing to them, they will be bankrupt very quickly if they did. Instead, they have to assess the issue, try to find a economical solution, get multiple quote and spend time finding a contractor who can do it reasonably well the first time at an affordable cost. That is not the same work as a farmer, but it sure is work. If it's not done the house quickly becomes unlivable with a broken toilet or whatever and being unlivable is also unrentable and produces no value to anyone. It's work, and it's important to keep the house functioning.
Really as you seem to think landlords do nothing but profit, similar to gnomes and underpants, perhaps you should give it a try yourself. If nothing else it will be quite a learning opportunity!
Yes, they use the money in order to maintain the house. Furthermore owner-occupancy is a thing, where the landlord does some maintenance themselves.
However no matter what, no landlord can maintain all aspects of the house alone. You think a single person can be a master of all trades and have all equipment on hand all of the time in an apartment, for instance?
Why does it even matter if someone pays others to maintain the house? Do you think there are people who build modern houses alone with no machinery?
Because homes are overpriced, because they're treated as capital instead of a durable good & because all financial / building policy advantages existing homeowners