When people say “investing” in real estate they generally mean buying existing houses, not investing in construction projects.
And “throughout the ages” is nonsensical, slavery is as old as civilization and yet abolishing it led to wealthier and happier societies.
Imagine if instead of real estate speculation that capital went into creating new technologies and businesses.