Same here and totally agree with you.
I've actually worked in Finance and spent 20 years abroad before coming back to Portugal and it was obvious already when I arrived 4 years ago, that government measures were rigging the housing market to be ever higher: Golden Visa in exchange for €500k "realestate investment", tax discounts for retirees from the rest of Europe to come live in Portugal, Digital Nomad visas, such a bullshit regulatory regime for AirBnB businesses that (eventually, after 10 years) the highest court finally ruled that unlike what the "regulation" said, you can't just convert appartments to AirBnB businesses as you feel like and have to follow the same rules as ALL OTHER BUSINESSES, and, last but not least, a complete total refusal to regulate speculative investment in Portuguese realestate by foreign investors (something as simple as a minimum 6-month residence in Portugal requirement similar to many other countries would've made a huge difference and still be compatible wth EU rules as it doesn't discriminate between portuguese and other EU citizens).
And this was just their Demand side manipulation.
On the Supply side, housing construction was down to 1/3 of what it was in the 80s and there is pretty much no public housing construction in the country of Europe with the lowest percentage of public housing.
Meanwhile we get loud "we've created 100 student accomodation rooms in this old government building we didn't use" announcements as if they're so amazing when the local unis take in 50 thousand students per year for what are typically 3 year courses so 100 new rooms once every 10 years or so is doesn't even touch the problem of student accomodation (itself a subset of the wider housing problem).
(Note that most top level politicians from the 2 parties that alternate in Government have declared income as "real-estate investor").
Portugal is were it is in housing because the Portuguese are mainly dumb and greedy votting for greedy, incompetent snake-oil salesmen.
That said, the "immigration problem" in Portugal has to do with how the country mainly takes in people with far less average levels of Education than the locals, and hence not capable of working in the kind of higher value added jobs as the locals (especially the young). This is why almost everybody working as Uber and food delivery drivers are from Brasil or the Indian Subcontinent - unlike most other countries in Europe, Portugal has very little in the way of selectivity in who can come (especially from Brasil, whose citizens are the largest immigrant community in Portugal) plus it can't really attract the more well educated as richer countries can, so you mainly get a whole different kind of brasilians in Portugal than you get in, for example, Britain were I also lived.
You can't really get your Economy to climb up the value added ladder (and hence pay higher salaries) if you're pushing the locals to have fewer children or, even worse, to leave the country as soon as they finish their degrees, by pumping up house prices to increase your personal rewards from the side-business that you have as "realestate investor" alongside your politician day-job, whilst "making up for it" by importing people with a way lower level of education than those children would end up having and those degree-holding young adults leaving because houses are too expensive already have.