Even if a particular landlord is a decent person otherwise, landlording is wrong. It is the hoarding of essential resources to for the purposes of being released for profit. If landlording was restricted to renting vacation houses (in appropriate areas) or something it might be OK.
The advantages of a rental (not worrying directly about maintenance, just paying someone to take care of it) can be had with a property management company.
Being a nonprofit landlord is also ok, imo. If you’re just charging enough to pay the mortgage, taxes, insurance, upkeep, etc. then you’re using your equity or credit score to help another person have a place to live when they wouldn’t otherwise be able to qualify for a loan. If I’m ever in a position to be a landlord, I’ll probably do it that way; and by the time you pay the equivalent of the cost of the home in rent if you want to own the place, I’ll sign it over to you. Kind of a rent-to-own thing.