Imagine a world without landlords. It's way worse than the one we live in now. It's a world where you cannot rent, you can only choose between buying or being homeless.
Landlords provide housing and most of them don't make a ton of money out of it. They hope for future appreciation of the property, which they can only realize if they sell, and their monthly income often doesn't cover the cost of ownership.