I am not a labor lawyer, but here is my understanding of how this could be legal:
Unions do have a right to be protected from what are called "unfair labor practices." These unfair practices involve things like trying to prevent union activities or union formation through coercion. The want ad, as you have quoted it here, does not explicitly call for any such coercive actions.
A manager could well "prevent" union activity through non-coercive means. Unions typically seem most attractive to workers who are poorly treated by their management. The want ad could, conceivably, be asking for a manager who will act in ways that keep workers relatively happy. If the manager did that, unions might have a harder time gaining traction among the employees. Alternatively, the manager could try to persuade the employees that unionization was not in their best interest. If the manager does this without threatening any punishment, there would not be a legal issue.
I agree that this does not sound legal and was probably not the most intelligent thing to put in a want ad. However, "preventing union activity" and "preventing union activity through coercion" are not necessarily the same thing.