Historically, the S&P grows faster than housing prices. So if you tie up a ton of capital in a property, the reduced growth + property taxes mean it's likely losing you money (not to mention any interest paid on a mortgage). Renting it out makes it a viable investment (and obviously it depends on where you buy).
Now, whether or not investments should be allowed for things which are basic human needs is another question.