The reason it can be done was touched on by Draken and that not every municipality in Spain has the same rules. They are being obtained in the north of Spain.
I will be delighted if these stop in the future. As you said they dont even bother to check who the person is and I have had clients that have gone themselves and even been given back their photographs that they attached to the top of the form!!