The law isn't justice. It's a very imperfect mechanism. If you press exactly the right buttons and are also lucky, justice may show up in the answer.
Train people well enough so they can leave, treat them well enough so they don't want to.
The quality of an organization's ethics determines the quality of its decisions.