And that's why you use a tool like taxation to modify behavior to encourage positive outcomes.
The distortions in housing markets are often partially caused by tax policy, and those areas should be addressed (tax deductions for mortgage interest for example). Other than that, it's best to actually deal with the root problem: outdated zoning laws.