You could say city folks have a revealed preference to live in the city, to be kind of sickly, and to have few kids. Or you could say city life is like an addictive drug, and when people say "I wish I could get out", they're being sincere. I wonder which perspective is more true.
We can start talking about "revealed preferences" once it's very cheap to move out of the city and to the country, and when it's equivalently cheap to move into a city. As long as big cities are absurdly expensive to live in and have all the good jobs, I'd say it's mostly path dependence at play.
(Also, as someone who moved to a small town, married and has a kid, I desperately want to get back to a large city - small towns are depressing and soul-suckingly boring.)
As someone who grew up in a medium-small city, moved to a large city, watched it get larger, and then moved to a small town (and who has no kids), I desperately want to stay the hell away from large cities. The sheer unrelenting friction of everything would kill me. And it's cheaper here.