Spain’s prime minister described the situation as an “attack” on its North African territory and said all illegal migrants would be returned to Morocco.