It can if you count it from a cost-savings viewpoint.
E.g, if buying costs $x, you pay $y a year for loan, insurance, maintenance, etc, and sell for $x later, and $y per year was less than the cost of renting, you win.
But most people would call that a "good deal" vs a "good investment".