Leo Tolstoy wrote Resurrection in order to raise money to help the Dukhobors, a pacifist Russian religious sect. In particular, the money was to help the Dukhobors relocate from Russia, where they were persecuted, to Canada. There was some trouble with collection of royalties. Tolstoy had tended to put all his works in the public domain, because he didn't believe in private property; so people were used to using his works freely. Since Resurrection was for the purpose of raising money, this was a problem; there were many, many pirated editions. However, the project was successful; Tolstoy and others raised enough money to send the Dukhobors to Saskatchewan, where they could live a frontier life without the problems of war. (You can read about the Dukhobors here.)
The actual plot of Resurrection was based on a story Tolstoy had heard from a lawyer friend, about a wealthy man who seduced a serving girl. This had led to the serving girl's dismissal, after which she fell into bad straits; years later, the man happened to serve on a jury that was trying the case of a prostitute accused of stealing money from a client. He recognized the prostitute as the girl he had seduced; his conscience sparked to life and he decided to marry the girl, who was sentenced to four months in prison. They eventually did marry. This story touched Tolstoy deeply. He himself had seduced a serving girl once; this had led to her dismissal, and the girl eventually died. He therefore took the basic story and adapted it to his own ends. As the work stands, it is a complex narrative tracing the moral resurrection of a man, and manages also to be an interesting narrative argument against punishment. All punishment; the argument is that no one has any right to punish anyone else at all.
Naturally, such a conclusion raises the question of how we would manage to have any society at all if no one were ever punished. Tolstoy's answer to this lies in his conception of the Kingdom of God, and, in particular, in his reading of the Sermon on the Mount (Matthew 5-7). Tolstoy reads this sermon as a sort of template for society. As the main character, Nekhlyudov, discovers, the sermon on this reading gives five injunctions that, while difficult for those not used to them, are all attainable by every single person. The five injunctions are as follows:
(1) "This was that one must not only not kill his brother, but not even be angry with him; he must not regard any one as insignificant, 'Raca'; and that if he quarrelled with any one, he must be reconciled before offering a gift to God, that is, before praying." (Matthew 5:21-26)
(2) "This was that man must not only not commit adultery, but must also avoid the enjoyment of a woman's beauty, and having once come together with a woman, he must not be false to her." (Matthew 5:27-32)
(3) "This was that man must not promise anything with oaths." (Matthew 5:33-37)
(4) "This was that man must not only not demand an eye for an eye, but must also turn the other cheek when smitten on one; that he must forgive offences and in humility bear them, and never refuse people that which they ask of him." (Matthew 5:38-42)
(5) "This was that man must not only not hate his enemies and not fight with them, but he must love, help, and serve them." (Matthew 5:43-48)
As Nekhlyudov muses, "Let the people execute these injunctions, and there will be on earth the kingdom of God, and people will attain the highest good, which is within their reach."
One issue that Tolstoy does not consider, and would need to be considered in this context, is whether we can avoid punishing people without violating requirements of justice. It's one thing to say we should not punish those who commit offenses against ourselves; it's another thing to say that no one ever has the responsibility to punish offenses against others. Nonetheless, Tolstoy manages to make an interesting narrative argument against punishment, which deserves to be more widely known. (And I, for one, found Resurrection more interesting and readable than I've yet been able to find most of Tolstoy's work. The characterization and description are not anywhere near as rich; but I think this actually makes the work more accessible than his works.)
[Quotations are from Leo Tolstoy, Resurrection. Wiener & Reeve, trs. Heritage Press (New York) 1963.]