The cost it's due to land costs, raw material costs, and to a lesser degree the architectural choices.
Zoning laws that favour urban sprawl with single use areas are a cause of high costs of houses in USA, but in other countries there are other causes. In Italy for instance there are very low investments on social housing project compared to the ones that were made in the '70s, either with rent, or lease to buy, and a lot of empty apartments that are kept as investments, but they aren't rentable because they need a total renovation, and a potential buyer had to add the costs of renovations to the selling price.
The most imprtant problem is that, especially in some areas there are private quity funds that buy houses and commercial spaces for speculation.