Yes, but that's also true of purchasing a house. Just because the price might not appreciate over the long term doesn't mean it's a loss.
You still got value in the form of shelter for your expenditure in the form of a mortgage just as you would have if you had paid rent.