Very true. A "morally flexible" lawyer still has disbarment and legal sanction to worry about, and this may provide a natural balancing force against illegal or immoral client requests. A morally-bankrupt programmer has almost none of those strictures or formal obligations.