[TW: mentions and discussion of suicide]
Quick disclaimer: I am not religious, so though there are probably deeper meanings when the musical mentions "God", "heaven", etc, I'm just taking everything at face value.
------------------------------------------------------------------
Just wanted to address the question why Javert is not in the finale of Les Mis the musical, where everyone who died and went to heaven (plus Marius and Cosette) sings together.
To me, the answer why is right in the lyrics - "To love another person is to see the face of god".
Let's first look at why other characters ARE in the finale.
As I see it, Les Misérables is primarily about love. The idea of love is prominent in the book, but it really is the basis of everything in the musical. As the quote above suggests, love is sacred. And this idea is why individuals like Grantaire and Éponine, who have otherwise done immoral or unsavory things, have their place in heaven - they both harbored an untainted love for another person (Enjolras and Marius, respectively) and devoted themselves to said person. In the end, they died for the person they loved, which shows utmost devotion, and, by the logic of the quote, did the most sacred thing by dying in that way. In other words, love purifies an individual.
Love is a constant across other deaths too. The Les Amis de'l ABC all died in their love and devotion for their ideals and for France. Gavroche died in devotion to nearly the same things, but his final solo focuses more on the poor and the spirit of the people. The Bishop died plainly, but he displayed love for and was devoted to the people for all of his time. And finally, Jean Valjean died having done his life's mission of protecting Cosette - in his love for her. Sure, not all of them loved a person, but all of them did devote themselves, wholly and purely, to something, and died displaying that devotion.
From this pattern it can be concluded that in the world of the musical, one must be devoted or in love with something/someone in death in order to pass into heaven.
Javert, however, did not love anything at all. In the book it is shown that he is a loner who preferred to operate independently of society. And in the musical, he didn't seem to care for anything at all except following his own moral compass. While this is a slightly more selfish cause as compared to the others, he was still purely devoted to it, so he should be in heaven, right...?
...unless his beliefs were diluted and rattled before his death - which is exactly what Jean Valjean's redemption did for him. The most obvious evidence of this is what Javert says right before his suic!de:
"And must I now begin to doubt
What I never doubted all those years?
My heart is stone but still it trembles
The world I have known is lost in shadow" (Javert)
Javert committed suic!de because everything that he believed in for his entire life fell apart suddenly, and he wasn't able to bear the pain of this shift. Yes, his death was on his own terms, but that doesn't negate the fact that he died without believing in or loving anything, therefore not granting him entrance to heaven.
From another point of view, if the central idea of the musical is that love is pure and sacred, then having a character who did not love anything ascend to heaven would be inconsistent and weaken the theme.
Personally, I don't have a problem with Javert being left out of the finale because this detail does not discredit him as a complex and generally well-meaning character (which, in my opinion, he most definitely is). It simply means that in the musical, he does not fit the requirements to be in heaven.