Point well taken, but that's underselling the problem by a lot. The American Psychological Association has a clear, strong code of ethics, but worked to help the CIA design torture programs. Not just 'psychologists' but the APA itself.
Codes of professional ethics seem to offer some defense against total indifference to malpractice and incompetence, as with civil engineering restrictions. People holding out for them to do more, especially around conscious decisions like political work, seem to seriously overestimate what they've achieved in the past.