Professional Ethics often can't stop companies from being evil (that's for government regulations, sort of, mostly), but they can help individuals stand up against such companies. Most such codes of ethics such as American Society of Civil Engineers Code of Ethics [0] or even the Association for Computing Machinery's Code of Ethics [1] are written to the individual first as a part of your relationship (membership) to the larger society.

Most of the actual effective power of such an organization in an ethics violation is to remove its relationship (membership) with an individual that breaks its code of ethics. In a field like Civil Engineering this has bite because few respectable, non-evil companies are willing to hire Civil Engineers that aren't members in good standing of the ASCE. When was the last time a software job interview asked if you were a member in good standing with the ACM? (Sigh, imagine if that saved you a bunch of time in that job interview, as a civil company wouldn't bother asking an ASCE member a laundry list of basic job knowledge.)

In terms of collective action, the professional society/association can help. If a civil engineer refuses to do a job, or whistleblows on a job in progress, due to it being a potential ethics violation the society (because it is not a union) cannot prevent that particular employer from firing the engineer, but it can: A) make sure that the firing is less of a black mark for other employers by making that information transparent and available to future possible employers, B) notify the remaining members at that company that they may be involved in an ethics violation which could result in loss of their society membership, C) notify potential candidates to that company that the company is involved in ethics violations. Sometimes that collective black list of "no respectable engineer will work for you" can be enough of a deterrent for a company to be less evil.

So Code of Ethics are a good step, if you have an association/society with some bite that would apply if they kicked you out as a member. They can sometimes leverage that collectively for overall good.

Organizations with further more bite are Unions, which can and do set contractual terms with employers that can force the company to adopt the Unions' ethics, and Governments, which can and do set regulations that are the closest we have to enforceable ethics terms on companies because Governments in the worst case have armies with which to enforces them.

Pulling it more specifically to your worries about surveillance, it seems to be almost directly addressed in ACM's Code of Ethics section 2.1. We've established that ACM doesn't have much bite in the tech sector, however, as employers mostly don't care about ACM membership. It would be interesting to see someone try to unionize software developers with a goal of promoting non-surveillance as a first principle, but software developers mostly don't seem to want to unionize because they see themselves as white collar and above such concerns as collective bargaining. (Despite many of Hollywood's unions being quite white collar and proving collective action can be essential, but I digress.) That mostly leaves government regulations. Data and Privacy are certainly things that governments could regulate, given they were shown a clear enough need, but also unlikely in certain political climates and by those that passionately are against regulations, even those designed to enforce ethics and protect privacy.

[0] http://www.asce.org/code-of-ethics/
[1] https://www.acm.org/about-acm/acm-code-of-ethics-and-profess...