Legal is probably the wrong word, but I don't believe you would have to pay this.
If the landlord is unable to identify which tenant messed up, then he should pay.
It would be like if someone sprayed graffiti on the side of the building. You wouldn't pay for the removal, the landlord would either have to find out who done it or pay it themselves.