The Stop Wall Street Landlords Act has been introduced in Congress by Rep. Ro Khanna. The bill would raise taxes on the purchase of single family homes by private equity and corporations.
It is sadly only de jure illegal and not de facto illegal. It's great there exists a law in the books, but if it's not being enforced it isn't illegal in reality.