Transport infrastructure (roads, buses, railroads, trams), housing, everyday service infrastructure (supermarkets, medical services, restaurants, haircutters) and employment infrastructure needs to be planned holistically or you're just shifting between problems - in the case of only going for denser housing, you'll lower homelessness a bit but get traffic issues in return.
And on top of that, city planning needs to take entrenched interests into account. Often enough NIMBYist complaints are founded in real fears of exploding traffic or a loss in property value - but these can be counteracted and compensated, if one is willing to.