Kafka was an insurance lawyer for the Austrian state. His job was to defeat claims for compensation filed by injured workers.
Sometimes, apparently many times, he chose to lose cases deliberately when he felt that the government was in the wrong. There are stories of him secretly preparing strong briefs for impoverished workers without counsel and without knowledge of the courts. This way he could lose the case without jeopardizing his livelihood by appearing to have thrown it.
Sometimes the ethical option is defeat.