Landlords can also deduct their interest expenses and so they benefit from leverage too (meaning they don't want to build up equity).
In a reasonably efficient market, this means that the equivalent cost of homeownership would be higher than rent, to offset these things (the rate at which you're paying down the principal, and the deductability of interest rate expenses). This is obviously a very simplified argument, and there's a lot of other factors going into this.