Let's say you save $100k. You can either buy a house, or put the money in the stock market. If you put it in the stock market, you get a return but that return ends up going to your landlord's profit. If you but the house you get no return but don't pay the landlord's profit.
In other words, it's an investment. If you believe that the RE market has better ROI, and don't mind being rooted, then go for it. If you believe the stock market has better ROI and you prefer to be mobile, do the stock market.
OTOH, as you say, the easy mobility associated with renting can be quite valuable to some workers. It's like, "what opportunities and profits am I foregoing by being tethered to a house here in this job market?" etc.
I think it's all very complicated and situation-dependent, as you point out. We need to predict the housing market, interest rates, the job market for our particular specialty, changes in tax laws etc in order to make an optimal decision. We're all forced into the role of economic forecaster just to make the most fundamental decisions about life.
Also, when you own, you can do what you want without having to ask permission. on top of that - no noisy neighbors that are too close!