I’m sorry to read about your experience however this type of behaviour is rampant throughout Spain. You should consider yourself fortunate (difficult, i know) that it was a communal door that was the focus of attention and not the door to your home!
During a previous stay in Spain, i stayed in a villa with my wife; we were in the grounds of the property when it was broken into and many of its contents (and personal items) were stolen.
Whilst i accept that taking an external door may seem extreme if not pointless, i too considered that breaking and entering when the residents are actually in the preoperty surprising.
However, we spoke with many locals after the incident and every person had a story to tell. It would appear that this problem is widespread and that those undertaking the thefts have no respect (or fear) for those involved or the law that they are breaking.
Its a reminder that we must always be vigilant – even more so when close to / or in our homes.