It's not just that the courts are bogged down meaning people can take advantage of the slow eviction process. A lot of places have a growing housing crisis, Barcelona especially, meaning there's a lot of people struggling to afford rentand being forced to look at less legal means of living in the city.
https://www.bigissue.com/latest/barcelona-fights-housing-cri...
https://www.catalannews.com/society-science/item/how-does-ba...
https://www.uab.cat/web/news-detail/the-housing-crisis-terri...