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.
Housing is of course a bit more complex - pricing is more sticky on the upside than downside (as home owners don't like to rent for less than before and may let units sit idle etc) and "instant" usually windows over weeks but fundamentally similar mechanics work. As an example, in Singapore, the government raised excise duty for non Singaporeans to purchase housing to 65% when housing became overheated. The number of rich foreigners buying property has always been small in absolute but was growing fast in rate as rich family money and bankers from Hong Kong started flowing to Singapore. Prices and also rentals across all classes of housing, not just the super premium properties favoured by the wealthy came down and people who had been pushed down at the margins into less than their preferred value housing (including ourselves) moved back up.