Housing is a good investment because it is a place you live in. When you own (and live in) a house, you ideally make both a short-term profit (by having a place to live) and a long-term one (from reselling it later). These aren't mutually exclusive.
And I think gp's point was that if housing prices rise (so that they're a good investment) then they become unaffordable (as we're seeing). One or the other, not both.