One other thing worth pointing out is that if the Spanish allowed flights inbound/outbound from GIB to use their airspace that is in close proximity (ie around Algeciras/La Linea) then this incident probably wouldn't have occurred. It is only recently that they started allowing diversions to Spanish airports.
Similar airspace politics contributed to the Crossair RJ crash at Zurich a few years ago.
Politics compromising flight safety.