The problem is not specific to foreign investors. Local investors are also more than capable of buying up perfectly good homes and letting them sit there vacant and unused. Whether the people are foreign has nothing to do with it. The problem is that society tolerates this practice of investors swallowing up housing, pricing people out of the market, and then leaving perfectly those good homes vacant.
Couldn't the solution be simply to enact a sufficiently punishing property tax rate on property not owner-occupied for more than 300 days of the year, so that these "investments" lose money? That would stop the practice, and maybe we'd see actual people/families moving in again.