Sometimes I dream with a wishful solution like defining areas of "great living desirability" (basically the cities where seemingly majority of people compete to live in), and charge a yearly tax of N% the market value of each home (with crazy high N, like 20), for owners who have more than M units in that area (with a convervative M, like 3 or even 2).
...You'll see how greedy investors flee fast, and the remaining buyers are honest people who don't want to speculate, but to actually own a home where to actually live.