Doing the numbers on (most) developed economies, buying freehold housing is typically a worse investment than stocks before leverage, but after, RE almost always comes ahead. Nobody is going to let you mortgage a basket of stocks, but almost any bank will let you do that with a house.
That said - I hate this idea because I think this kind of thinking is what has lead to many of societies problems in the developed world at the moment. But, from a rational point of view the numbers make sense.