Honestly, it depends on your unique situation and includes factors such as where you would like to live, the cost of purchasing vs. renting in your area, how nomadic you are, how disciplined you are with saving and investing, etc. You need to sit down and do the math, as well as take your personal desires into account.
I have been a homeowner for a while now. As a bachelor, I had a larger home that I home shared. It worked out well for the most part and helped pay the mortgage and maintenance of the home. Ironically, after I married, we downsized significantly and currently have no mortgage. This really accelerated our path to FI, more significantly than any other factor. Well, having two household incomes was a large factor as well.
Many home buyers fail to realize that with the purchase of a home comes a myriad of other costs that go beyond the mortgage payment. The typical ongoing costs of a home look something like this: Mortgage + Fees + PMI + Property Tax + Insurance + Maintenance + Repairs + Remodels + Association Fees + Utilities = a Big 'ol Hunk of your Monthly Income and Time. All or most of these costs can be avoided by renting. Typically, with the exception of utilities in some cases, the total cost of renting is your monthly rent + renters insurance.
Also keep in mind that every time a home buyer "upgrades" and takes out a new mortgage, the amortization of the loan starts over. In addition, the selling and purchasing of a home can come with a lot of fees and taxes. As a result, it is very expensive to keep moving and purchasing homes, thereby reducing your ability to build equity and prolonging the process of becoming debt free.
Oh, and don't forget about opportunity cost. Opportunity cost is income you are not earning because a portion of your stash is tied up in a home instead of making investments elsewhere, such as the stock market.
With all of this said, to many, home ownership is not solely a financial decision. Most of the positives for owning a home that hold any merit for me have more to do with lifestyle choices than finances. For example, home ownership can provide you with more options regarding the type of home and area in which you would like to reside, especially if rental options are limited. If you happen to find your utopia, your home base, and plan to stay put, then home ownership becomes more valuable and may actually provide increased benefit.
If you are the type of person who finds a sense of security in "owning" your home, or you are uncomfortable with a landlord having any degree of control over your life, then home ownership may hold more value for you.
Finally, if you have already gone down the path of home ownership and your mortgage is either paid or almost paid off, home ownership may hold some value here as well. Debt free and rent free is a good place to be, both psychologically and financially in some cases. Just remember to account for the other expenses of home ownership as mentioned previously.
In the end, whether you rent or buy, the bottom line is to make a choice that enables you to live well below your means. Just be realistic and do the math so that you purchase or rent a home that doesn't make you feel imprisoned by debt and allows you to maintain a VERY high savings rate. This calculator at Financial Mentor is one of the better ones I have come across:
https://financialmentor.com/calculator/rent-vs-buy-calculator. Not only does it consider opportunity costs, but it comes complete with terms and definitions at the end of the article. Start by running the numbers and take it from there.
I hope this long drawn out post was helpful.