The Madrid city council has approved a special plan regulating holiday
rentals that will foreseeably shut down over 10,000 apartments
currently used for short-term tourist stays.The new regulations stipulate, among other things, that apartments
used as holiday rentals inside residential buildings in the city
center must have a separate access area from the one used by regular
residents. Guests will not be able to use the same building entrance
or elevators.
I don't see how that will stand up in court-though I don't know Spanish law. An easier way seems to be to regulate how many vacation flats are registered in the city. Just a heads up for anyone looking for a flat. Even on VRBO, half of the holiday flats in Madrid still aren't registered by the city.
https://elpais.com/elpais/2019/03/27/inenglish/1553702152_849878.html?id_externo_rsoc=FB_CM_EN