- It will make it impossible for people without permanent residency to buy property. - It will prevent people from owning multiple homes in the country.
You could also define a minimum number of days a year where they had to prove that they occupied the property, maybe at least a quarter of a year.
It's actually a moderately complicated thing to prove, even though it seems it should be simple.
In this case, you could just tax foreigners for owning property. Or you could tax non-residents for owning property.
A land value tax would be a good idea in general. But if it's politically necessary to restrict that to people from far away, that's still better than a ban.
Taxes give you a behaviour change and revenue. If the behaviour doesn't change, you can jack them up to get more revenue.