This is a silly analogy; we purchase food because the opportunity cost of subsistence farming is far higher than buying it from a supermarket.
The issue, to my mind, of renting vs. purchase is much simpler.
a. Rent will most likely remain a fixed percentage of your income.
If you are paying 30% of your monthly income in rent today, in 10 years time, you will still be paying 30% of your monthly income; whereas a mortgage, as a % of your income will be less in 10 years.
b. With the exception of social housing, you have no real security of tenure when renting; whereas no one can put you out of your home.