Not just Portugal but Ireland, and of course Canada ended its wealthy visa class (Quebec pausing theirs) and BC brought in its foreign buyer and empty homes taxes.
For a while there it was clear that policy makers seemed to think that foreigners buying real estate was somehow a quick and easy way to turn around the economy. Somehow thinking foreign wealth merely being around would induce more wealth to appear as if by magic.
1. bring in a bunch of wealthy people to buy real estate
2. ???
3. Tide lifts all boats and economy does great!
Unfortunately what actually seems to happen is that you end up with a bunch of mostly empty pied-a-terres, the rich foreigners leverage the opportunity purely for a passport and don't invest or start new businesses, and the home building industry pivots increasingly toward building turn key pied-a-terres that are useless and expensive for locals.
It all results in a situation that's worse for the economy, a spiking cost of housing and living.
What policy makers should really be striving for here is an extremely low cost of renting which keeps money in peoples pockets that they spend and invest in creating their own local busineses.