Beth Haile dissects the moral theology in Les Miserables (spoiler alert):
In the end, Valjean is a man, "no worse than any other man," as he explains to Javert. The critical difference between the two is that Valjean is willing to live out a life of mercy. He is willing to both give and receive it while Javert can do neither. When Valjean offers Javert mercy, saving his life at the barricade, Javert is tormented. His system is broken, his god dead. As his world comes crashing down, he plunges into the Seine. Valjean, on the other hand, looking up with shame into the eyes of the bishop whom he just stole from, chooses to accept mercy, and then give it in return–to Fantine, to Cosette, to Marius, and even to his enemy.
Victor Hugo apparently had a strained relationship to the faith but the story has a very Christian message: "To love another person is to see the face of God."