Tourism contributes approximately 14% to Barcelona's economy. This sector also provides around 150,000 jobs in the city. Barcelona's unemployment would be about 20% without those jobs.
This is like movie stars who are rich and famous and complain about the paparazzi. There's downsides to everything.
Either way, it's really easy to financially disincentivize tourism. Just raise your hotel and taxi fees by a couple hundred. Just be careful what you wish for.