Landlords owning property is not a problem. Some people prefer to rent - they may be students, or they may not anticipate being somewhere for long, they might not want the risk of owning a home, lots of valid reasons. Having housing available for these people is good and landlords are a necessary and valid part of this market.
The problem is when people who want to own houses can't afford them, even when they contribute meaningfully to society. The root cause of this is not landlords existing. It is wealth inequality. A vanishingly tiny number of people own almost all the wealth in the system, to a point that the additional wealth gives them no real benefit, but serves only to remove that wealth from the vast majority of otherwise middle class people.
If you want to fix this problem return the top tax tiers to what they were 50, 75, 100 years ago and the problem will be severely reduced. It's not sufficient to solve it, but its low hanging fruit.