They're more expensive per person in cities with a higher cost of living, which often correlates with density. But zoning restrictions increase the cost of living by contributing to housing scarcity.
Density isn't the cause of high cost, it's the response to it. It's the market increasing supply in the presence of high demand. When prices are high you want more of it, not less.