They are freeing up ~10,000 houses over the next four years with this legislation. Barcelona built ~15,000 new properties between 2011 and 2020.
The math don't math. It's a drop in the bucket. The entire impact of AirBnB + all housing built in the last decade does not offset the last half decade of population growth.
Housing must be built more quickly than your population is growing to keep prices down, or you must concede that you live in a nice area where people wealthier than you wish to be and that those people are going to gentrify the area and displace locals. It's an unpleasant reality of the world.
EDIT: some good feedback in the responses. thanks! I'm being a bit dramatic by saying it's just a drop in the bucket, this action frees up more housing than was built over the same timespan, and it's possible to have effects on pricing greater than what would be inferred by the raw numbers because economics is tricky. cheers.
Still, I fear that people generally look to politics for simple, one sentence solutions to problems which take decades to manifest.
Barcelona is the 68th densest city in the world. You look at a satellite map and you can see they have a very well planned city layout. It's dense and filled with tall buildings.
At some point the only lever left to pull is outright banning of foreigners. I'm not condoning that policy - just trying to highlight the futility of attempting to protect a desirable area from overpopulation.
That does not follow at all. If you look at the actual densities Barcelona is 1/3 as dense as the densest city in the world. There is plenty of room to accommodate more housing, they just need to build higher.