NYC metro population grows from 18.3 to 19.8M (8%) [2].
It's harder for NYC to under-build for a century when the population has not grown as much. Chicago isn't exactly a developer's utopia...
[1] https://www.macrotrends.net/cities/22956/chicago/population
[2] https://www.macrotrends.net/states/new-york/population
If you isolate just the city - NYC does grow from 7.8M to 8.8M (12%). Manhattan goes from 1.54M to 1.69M (9%).
Chicago's downtown population growth is >40%.
In any case, though, the original question is whether population density actually makes a place less desirable. The mere fact that Chicago is not cheap (not simply inexpensive, but actually cheap) contradicts the claim that population density is something people don't want.
They don't want density for the sake of density.
NYC has better opportunities - that's why it's denser. It's not denser because it's more desirable, and then it just so happens that it also has opportunity.
This is true for Shenzhen and Beijing and Mexico City and Paris and London and Mumbai and every major city.
Why is NYC so much more expensive?
Because people can make more money to spend on more housing in NYC...