There are many things in “Les Mis” that are immoral, I don’t trust Hollyweird not to exploit them for prurient reasons. Plus this book was originally a big recruitment device for the communists, so I am suspect doubly.
I take it you have not actually seen the film and have therefore made a judgment on hearsay.
The immoral elements you describe are necessary for the story itself. You cannot have a man imprisoned for 20 years without him having first stole a loaf of bread. You cannot have a story of repentance if there was nothing to repent from. Stealing something is immoral, except under certain extreme cases.
The horrible things other characters are forced to go through are also part of that same story of redemption.
Also, communists twist the wrong meaning out of many stories in order to make them support their position.
Would you refuse to believe the words of Christ when he says “blessed are the poor,” because some group misinterpreted what he says to suggest that they should overthrow the bourgeoisie? Some Communists have even attempted to use even the Gospel to support their cause.
Its wrong to condemn a work because you don’t know what is in it, and think you know without having checked. The film itself is morally OK.
I've seen several stage productions of this play, and the ending always has a scene where the dead revolutionaries once again stand alongside their surviving friends. I think it possible that for those who wish to interpret it thus, that scene may imply that eventually "the cause" will succeed - even though it failed in this instance.
And that failure is certainly evident. The cost of the revolutionaries' failed struggle is one of the clearest messages in the story, second only to the story of religious redemption (apparently another part that the Commies skimmed over). The ministers kind act changes Valjeans life forever. It causes a domino effect which along the way, includes a focus on productivity, middle-class respectability and charity.
I've read the original book, over 1,000 pages worth. IMHO, one would have to be a Communist in order to read anything there as some sort of positive affirmation of that ideology. The revolution's leaders needed the people of Paris to rouse themselves and join the fight, and it didn't happen. No glorious "workers' paradise" for them. C'est la Vie.