Good question. If there were an easy answer, we would have resolved the issue, or at least had some potential solutions in recent years.
I think that the root of the issue is largely political. As you said, the government determines how many people enter the country. However, ultimately, the cities, and particularly the city councils, have a great deal of power over where these people will be placed and what support they'll receive in the cities. We must find a way to change the incentive structure so that the interests of the council members and the people who live in the cities are more or less in line with the interests of the federal government, and therefore with national interests.
The solution may lie in the transfer of significant financial incentives to the cities. Various things can be done to try to balance the incentives. In my opinion, this is where the issue lies. Like it or not, the “not in my backyard” syndrome is a particularly powerful factor in holding back real estate development to some extent. Basically, you end up with less housing, and both tenants and owners are paying more.