Inspector Javert, as we know him has been a very complicated character and I strongly believe that. Many of you may think of him as the vile and cruel police man but I am here to prove that whoever may think he is the "Snake in the Grass" might have misunderstood him.
Javert is the law. He makes sure every citizen is abiding the rules. In other words he is very obsessed with the law. But we must know that Javert is doing the right thing. Javert said "Mine is the way of the Lord." Which means that he praises the Lord and that he is trying to make everyone to do the right thing even if it leads to obsession.
He thinks that he is doing what the Lord wants him to do. He never did no wrong. He was doing the right thing but he is just so obsessed with the law that he is already doing things that leads to wrong.