Sorry, economics don't work that way. If you build more houses, and build them more densely, it increases the supply. If corporations buy them up, they're still competing with each other and won't be able to raise the prices too much. They're only able to keep raising prices because supply is limited, so stop limiting supply.
You don't need to ban housing investment. We don't have any such laws here in Japan. The only reason they're able to treat housing as an investment in other places is because of a lack of supply. Here, there's lots of supply, because the laws don't forbid development the way they do everywhere else. There, housing values increase over time because of the shortage. Here, housing values decrease over time: buying a house is never a lucrative investment, just a way to avoid rent increases (or having to move), to have control over your own home, because you think the land might increase in value (maybe they're going to build a new subway station nearby in 10 years), etc.