Surely there are multiple ways ro tackle that, e.g. one could require permits for those as well, but I didn't defend the measures taken by Barcelona, I defended the fact that unregulated AirBnB can turn into a problem for a city and the people living there.
In Barcelona, making apartments available as short-term rentals involves the exact same type of reglatio that hostels need to go through to operate.
If AirBnB is suddenly deemed a problem in spite of the absolute lack of evidence, in the very least regular horeca businesses are more to blame.