Probably related to public transport existing and commuting being less soul crushing.
For one thing, public transportation is absolute garbage and basically useless outside of NYC. DC, Chicago, and Boston are pretty much the only other cities where being dependent on public transportation is really viable. Of course you can do it in other places and millions of poverty stricken people do but it's rarely by pure choice.
Then it basically boils down to what's the point of living in the city? If opportunities for work are removed from the equation, it is mostly just going out to eat / drink and to the big ticket events that don't exist in smaller towns.
The dining and entertainment options are increasing and vast in small towns while urban venues are closing and there is a huge trend of the major event centers moving to suburban areas. The preference for outdoor recreation vs big ticket events means you are simply driving into the city for those things but able to enjoy much more of the things for which you had to previously drive out of the city.
The remaining big factor, which is probably not prevalent in Sweden to the extent that it is in the US is crime and the reality is you are far more likely to be victimized in urban environments. Police responses are lacking and most people don't even bother reporting low level property crimes anymore.