This is a modern take on the Nuremberg defense.
You're right in a way. Values like these come from the top, in the project manager, the CEO etc. Morality is found in the company culture, and shouldn't be found exclusively in the worker bee software engineers.
But what else I see is that this can also come from the bottom up, in the way software engineers can "manage up". Software engineers are by definition more intimately aware of the details of a project, and they need to be listened to by management when they have a concern. Because frankly management can't be so aware of the details. It's our responsibility to be concerned about ethics, so that we can better manage up to spread that concern throughout an organization, so that it can filter down to someone else.