Because I guess to him it was the story of the rich vs. the poor, and Javert protected the rich, ergo he had something to gain from it materially. It’s total anti-canon BS, of course, since Javert gained absolutely nothing except the knowledge that he did the Right Thing.
This is something for people to keep in mind when they write Javert’s character as cold, wrathful, anti-social, misanthropic, spurning contact with others, etc. Hugo may have written that snuff served as Javert’s only connection to the rest of humanity, but he neglected to spell out why: snuff was the only object in his universe that didn’t hate him.
“Stop, Mr. Mayor; one word more. I have often been severe in the course of my life towards others. That is just. I have done well. Now, if I were not severe towards myself, all the justice that I have done would become injustice. Ought I to spare myself more than others? No! What! I should be good for nothing but to chastise others, and not myself! Why, I should be a blackguard! Those who say, ‘That blackguard of a Javert!’ would be in the right. Mr. Mayor, I do not desire that you should treat me kindly; your kindness roused sufficient bad blood in me when it was directed to others. I want none of it for myself. The kindness which consists in upholding a woman of the town against a citizen, the police agent against the mayor, the man who is down against the man who is up in the world, is what I call false kindness. That is the sort of kindness which disorganizes society. Good God! it is very easy to be kind; the difficulty lies in being just.”
Javert has to force himself to exercise punitive functions with respect to non-violent criminals. It doesn’t come easy to him. Being kind would come easily, but he can no more be kind than a prosecutor can be kind towards the man he works to convict: that’s not his job. No more than it’s the job of a defense attorney to work to convict his client if he thinks the client committed the crime in question. The police and the judicial system divides its labor for a very good reason. Javert’s job is to locate and arrest suspected malefactors. That’s what a cop does. It’s not the cop’s job to be judge and jury. He is happy enough to pursue and apprehend people he considers a genuine threat, like Valjean or the Patron-Minette gang. People like Fantine, not so much.
It must make such a job a great deal more difficult when you are not allowed any outlet for kindness even outside of your work. Javert had no one to be kind to, since no one would have him in any capacity, as friend, as lover, etc.
The world conspired to make Javert a bastard. He bore it well so long as he could justify it by a) being as severe with himself as with everyone else and b) assuring himself that his unkindness serves a greater Good, namely security and order. Valjean destroyed both of these justifications: as a magistrate, he did not allow Javert to punish himself, which rendered him a hypocrite, and as a convict, he opened Javert’s eyes to the fact that the Law sometimes destroys the lives of good people for trivial offenses.