I've been in Barcelona multiple times over the last few years and it's one of my favorite cities. There are few places where the locals are as accommodating towards tourists but there are limits to how big a proportion of tourists : citizens you can have before there have to be some rules.
The fact that rent prices have jumped up tremendously to the point where locals are pushed out of Barcelona to make way for yet more professionally run AirBnB hotels (which are open 24x7 and all year round) does not help either.
If you see this as 'anti-tourist' imagine that the town or city where you currently live becomes the next hot thing in tourism and you'll be forced to go live somewhere else, or it will be impossible for you to get a spot on the beach in your city and so on. Sooner or later you too would be a big proponent of some reasonable restrictions.
I've seen some incredibly rude and downright criminal things in and near Barcelona on account of people who were just there for a few days, if anything the population is very restrained in how they are dealing with this, especially because it is for a large fraction of them their daily bread and butter.
But I'm really not surprised by what is happening there, the same is happening in many other tourist spots the world over (Amsterdam being another one, for instance).