One of Spain’s top courts has backed a plan to shut down short-term holiday accommodation in Barcelona, as a way to address rising rents.