I imagine that most layers are just doing their job and getting paid for it. Bringing morality into that equation makes no sense in a legal system that has little to nothing to do with morality.
The standards of ethics they are checked against are not yours or mine, they are the rules they agreed to. To pretend like ethics aren't a thing for lawyers is surprisingly uninformed for HN.
I bet you change your mind about the ethics of having a lawyer represent you.
Unless you are the sort of person that claims that reality is just an opinion, too, in which case you should also study formal philosophy.
Ethics is a matter of philosophy, which has a bit more going for it than just being composed of raw, uneducated opinion.
You are thinking of morals. That is a matter of opinion
A system that didn't need to hold a trial or give the mob boss a lawyer would be irredeemably immoral but one in which they go free is a shittier world. I don't envy anyone trying to remain moral while walking that line. I don't see how anyone who specialized in such clients could live with themselves.