There's a lot of costs that go into construction, the actual expense of putting together the parts to make the thing was at one time the biggest one, but not any more.
With all those new technologies that increase the efficiency of buildings and construction come technicians who expect to be paid well for their expertise, so for every manual job removed there's an expert who needs to be paid about as much or more to operate or plan the labor-saving technology so implementing the technology may not actually reduce the cost to the builder at all.
For the parts that do still require manual labor, that's been getting a lot more expensive and hard to find, because hand-in-hand with people specializing in all these fancy new technologies, the appetite for manual labor employment in developed economies has fallen, which pushes up the cost of the parts of construction that technologies hasn't changed.
Regulations and requirements have also massively proliferated in the last century. The number of inspections and approvals that any piece of construction needs is pretty crazy compared to the prewar era, plus new requirements and design limitations set by law that, while good for society (anti-fire, disability access), can sometimes drive up costs or limit design choices because ramps take more space than stairs and fire sprinklers represent a doubling of the amount of plumbing work you need to do.
Land has gotten progressively more expensive as it has become more scarce. Sprawl kinda reached the limit of what commuters are willing to tolerate in the 90s, so nobody can do cheap greenfill development anymore (anecdote, my parents had a new house built on the outskirts of Phoenix in 2006, with a 70 minute minimum driving commute, which I would absofuckinglutely never tolerate for myself): you need to buy more expensive interior land to redevelop. God help you if your local land use regulations require you to provide free parking, in which case you may be forbidden from building on as much as 2/3 of that very expensive land you just bought.