As long as enormous profits can be generated through the sale of residential housing it will be viewed as a capital commodity like any other.
Simply impose a punitive level of capital gains tax (say 85%) on any property that isn’t a persons primary residence. The exception being a property rented out at an affordable rent (not affordable linked to market rental prices) .
I also extend this policy to any primary residence sold within 3 years of purchase.
By targeting capital gains you don’t prevent people from moving you simply prevent profiteering from this.
This instantly stops residential property being seen purely a a capital commodity but doesn’t prevent those who want to rent out at a rate above an affordable threshold and profit from income rather than capital gain, and by so doing means that empty housing will be a liability.