I haven’t seen the musical, but in the book the dilemma is sharpened because Champmathieu is a completely innocent simpleton. He had never been in prison before. He’s arrested for a ridiculous petty larceny (stealing apples), and he’s probably innocent of that, too (he says he found the apples on the ground).
And yet, once he is identified (falsely) as Valjean, he faces life in prison.
Just the same, human beings are great rationalizers. Valjean is morally innocent as well; his original “crime” was stealing bread to feed his hungry family. As Valjean I would reason that one way or another an innocent man has to suffer, and why should it be me, since I have already suffered so much and my freedom helps my employees and townsmen, whereas Champmathieu will not be missed?