You have to look at the *total* cost of the house, not just its sticker price. This includes all the maintenance that goes into keeping the property in shape (eliminating pests, landscaping, exterior work, routine interior upgrades, etc.) as well as property taxes and mortgage interest (if collateralized).
Your opportunity cost of owning the home is the sum of all these outlays, compounded over time.