Depends on the job. You won’t send a female cleaner in a male locker room.
Also some recruiter are explicitely trying to correct a gender imbalance and are therefore actively seeking female candidates. Does that become unethical to advertise to women?
That's a bad example. There are many jobs where men clean female locker rooms/restrooms and visa versa. But I agree with others (and I think you) that it isn't Facebook's responsibility legally to ensure it isn't possible for companies to break the law. Might be able to make a moral argument, but that's a different argument.
Also some recruiter are explicitely trying to correct a gender imbalance and are therefore actively seeking female candidates. Does that become unethical to advertise to women?