Outside of downtown areas in the biggest cities in the US, it is very unlikely that a hotel is built in an area that people would want to build residential housing.
Normally hotels are built near either business or tourist areas. Very few people want their residences in the suburban office park areas. Tourist areas tend to be older areas that have strong restrictions on new development--hotels there have to go through long permitting processes.
Well look at a map of Barcelona. Hotels are in the middle of residential areas throughout the city. Not sure what the permitting process has to do with any of this. Hotels take up land. Land that could be used for residential housing. Permitting can be changed by law (same as banning AirBnbs).