Or you could build apartments. The law doesn't say you can't build rental property, just that you can't build houses as an investment.
Furthermore, I'm not completely convinced that restricting rental property ownership to property management companies who can afford to build apartment complexes is inherently more equitable than letting a middle class person with good credit buy an extra house and rent it out. Where I'm from originally (Alberta), it was common for electricians/plumbers/tradesmen to buy an extra property with a combination of credit and wages and maintain it. It's a relatively simple and time-tested path for moving from working/lower middle class to being upper middle class or even wealthy.