This would only make sense if you want to live in a place indefinitely. When the economy here (Alberta, Canada) tanked due to falling oil prices, people who were renting and were laid off simply gave their 1-2 month notice to their landlord and moved to Montreal or Southern Ontario for better employment opportunities. Those who owned could not do that without taking a huge loss, selling their house for less than the price they bought it for, potentially less than the remaining mortgage obligation, potentially leading to their bankruptcy. As for renting it out? Forget about finding a tenant in that economy. And even if they did, how could they manage a property from the other side of the country?
Mobility is worth more than zero. If you think the economy in the place you are living is going to be good for the rest of your life (or at least the rest of your mortgage term) and you are certain you would not want to move during this time, go ahead and buy a place. Otherwise, it makes sense to rent.