Our prosperity is relative to the place where we live and work. For example, a person surviving on a government pension in Australia will be able to live like a rich man in most places in a third world country (but probably not in a major city).Therefore it is only fair that a person not allowed to buy real estate in foreign country because of this disparity. Otherwise it will upset the socio-economic balance, and hence the way of life, to the benefit of those in the rich country.
When I was in Bali, I was told that you can buy an acre of padi field for less than AUD$15k. The villa we stayed in in Ubud (in the middle of a padi field) was built and run by an Australian. I think this is an injustice to the local Balinese. A local who works hard and is saving up to buy his own padi field will inevitably be priced out.
In parts of Australia, farmlands have been quietly purchased by foreigners, with the intention of mining for coal. There should be a law against this, as the transaction price does not reflect the true value of the land. Farmland is a contributor to the GDP. It is a renewable source of income, unlike mineral resources which get exhausted eventually.
Governments should enact laws to ensure that farmlands are not sold to people who are not interested in adopting the rural way of life, be it to foreigners or to city-dwellers. These people are only interested in buying a laidback lifestyle but not the life that comes with it.