But surely the interest makes up for this. It wouldn't make financial sense for the lender otherwise; why lend money to homeowners if it won't beat inflation than, say, invest it in the stock market?
In the US, the interest is tax deductible, so if you have earnings to match against that, the effective interest rate to the buyer is only 2/3rds of the nominal rate on the mortgage.
So then wouldn't the buy/rent decision depend on your income tax rate?
If recent history of the mortgage market tells us anything, it's that lenders are not too concerned with making financial sense.