With housing it's more flexible: you can commute longer each day. You can just not move to a city where you know the "salary/cost of living" is not working in your favor. You can also time these decisions: go to NYC when you are in your 20s, live with some roommates to get some savings and then when you get older you can move to a more spacious city. You can be flexible about the space you need too: from 1 bedroom in a shared apartment, to a 3 beds detached house in a quiet suburb in another city, there is a lot of flexibility.
In a city there is a constraint on how much you can build, and everybody wants to be there. You can let the free market set the price, or you can try to distort the market with rent controls and then you end up with black markets, illegal payments, people holding on to their apartment for way longer they would normally do etc. Why would a 1 person ever move out of a large apartment if they have a low rent? They don't care that the same apartment would be a god-send for a family of 4...