It was illegal for the officials who did it, not for Meta/Google to follow their orders. That part was merely unethical.