The anti-immigration party Vox was the only one to vote against the bill after the conservative People’s Party had a last-minute change of heart.