Kafka's Trial questions the relationship of justice and the law (often capitalized in the novel as "the Law"). The thing about laws is that they're supposed to be just. If there's an unjust or an unfair law, we expect to be able to work to get the law overturned by appealing to higher principles of justice. (Consider, for example, the Civil Rights Movement. Racial segregation and discrimination were unjust; therefore we appealed to a higher principle of justice – racial equality – to eliminate those practices.)
But here's the thing about Kafka's vision of the Law: the Law is such an abstract ideal that it can have nothing to do with the ordinary lives of human beings. Put it this way: the idea that all human beings are equal is written into the United States' founding documents, but do we actually have a country where everybody is equal? Would it be fair for the government to come in and mandate certain types of equality? No matter how committed you are to democratic ideals, many of us would hesitate to give up our hard-earned wages – what we consider the individual's equally valid right to his or her own property. While the ideal that everybody is equal is just, actually putting it into practice could result in an unjust society where people's property is unfairly taken away from them.
What makes Kafka's novel more of an allegory, however, is that, rather than giving us a concrete political issue (like economic equality), the novel gives us just the bare struggle of one individual against an unspecified Law – not any specific law, just the Law in general. The court is just the human and bureaucratic embodiment of this Law. Just as the Law seems inhuman and unjust precisely because it is such an abstract expression of justice, the court is portrayed as equally inhuman and unjust. Thus another paradox of the Law is that it can't just exist in abstraction; it needs the court. But the court, as a system run by human beings, inevitably corrupts the law. Kafka's novel nicely indicates the court's corruption through its sordid offices and its lusty judges.
But here we have yet another paradox in the Law. The first paradox is that the Law is supposed to be an expression of justice that transcends all individual human cases, but it is, in fact, unjust because it is so abstract, because it is oblivious to the individual human case. The second paradox is that the Law is an abstract ideal, but it needs the court, a concrete human system manned by human workers, to exist. The third paradox is that, even though the Law is abstract and above all human affairs, it saturates all human affairs. You just can't escape the Law. No matter how Kafka's hero tries to escape the court, to free himself from the court, he only finds himself dragged deeper into its web. Just like the man from the country in the parable of the Law, Kafka's hero's fate attests to the desolate wisdom that we are always before the Law. If we think we can exist outside or without or beyond the Law, we may be the most deluded people on the planet.
The Trial deplores a legal system that is alienated from the existence of actual human beings and follows its own arcane rules.
While K.'s trial ultimately ends in his execution, his manner of dealing with his trial demonstrates a human dignity that is superior to Block's subjugation to the whims of an unjust legal system.