Canada has a well-developed and diversified economy. Portugal needs to import a lot from the world, but has very little to offer in exchange.
They found something: their real estate and city center spaces.
The country NEEDS this foreign income. It's not a self-sustainable economy and the world won't work for them for free. If the Portuguese want to solve this issue, one way is to study what else could they develop internally that would be attractive in the world trade market.
Also, foreigners are looking for the European passport, not for Portugal per se. If Portugal were to follow UK's path, demand for their Golden Visa would drop dramatically.
It doesn't benefit the rich, only. By raising real estate prices, it stimulates the construction business, which is labor intensive and has a long supply chain. It benefits the entire economy of the country.