Your beliefs are your beliefs. I see Valjean following the example of the monsignor who forgives him for staeling. He does again with the man mis-identified as 24601 and again with Fantine and ultimately with Javert. His were not acts of selfishness in any way.
Have you actually read Hugo’s work?