One of Spain’s top courts has backed a plan by Barcelona to ban holiday apartment rentals by 2028, rejecting an appeal that argued the measure infringed on the rights of private property owners.