High density living in a downtown area is inversely correlated with having a family across a wide selection of different countries though. The highest density countries like Korea and Japan have some of the lowest fertility rates.
I'm going to doubt that's because of density. That's entirely because of toxic aspects of the cultures (especially work and education culture) that make it near impossible to have and raise a child for the first few years of their life.
There are high density countries with high birth rates though; they're either very religious (Israel) or very poor (Africa).
https://academic.oup.com/endo/article/162/11/bqab154/6354390