Or have just enough hotels for how many tourists they want. Who cares if 3 billion people could and would visit Barcelona tomorrow. Nobody is obligated to build enough hotels for them.
Precisely. I live near Yosemite National Park, and it would be an absolute disaster if there were enough hotels, campgrounds, and amenities to meet the demand. The demand FAR exceeds its capacity for tourists, but it would destroy the very reason for that demand if that actually happened.
So what did they do? Set rules for the number of tourists allowed in the park per day, and stuck to it.