When two things happen concurrently, it can be hard to tell cause and effect apart.
In reality, real estate speculation is driven by the simple fact that prices always go up, making it one of the best investments there is for those with enough cash.
If you legalize massive housing construction, housing prices will start going down, and the speculation money will have to go elsewhere.
To discourage speculation, governments should impose land value tax, but not property tax, to encourage efficient use of land. You'll also need to pair with other reform, like changing how zoning should be done, how transportation is planned, and so forth.
If more houses are built, prices will go down.
Has anyone done some math on the housing density that is most economical? My guess would be that the height limit would be close to five or six stories before the engineering to go higher was excessive, but that is just a wild guess. Courtyards down to ground level so people can have an external view seem wasteful from a heating and cooling perspective, most people don't want to live with no windows.
The real solution would be to fight the speculation and accept acces to a home as a human right. So prohibit/tax unrented rentals, progressively taxes owning multiple homes.
I live in a poorer EU country where foreign money bought everything they could. They dont even bother renting it out because increase of the value of the properties is where the money is. If they started to rent the evaulations would fall.
The answer is to remove housing as an investment vehicle. Also prohibiting the ownership of multiple houses by a single individual or institution.
No, it's driven by supply and demand.