The way a secret service orders a company to participate to their surveillance systems is not only using the law. It is often by performing ad hominem blackmailing, so even if the CEO orders everyone to reject participation, the low-level operator will let the NSA person in, and his boss will cover the leak in fear of his child being taken in for drug use at his high school.
In addition, some people will do it voluntarily (and not talk about it), motivated sometimes by profit (bribes) or some sense patriotism[1] and duty. There are many authoritarian collaborators in this country - including way to many from the tech industry.
[1] misplaced, as they should be supporting the Constitution, not a particular administration