Every dialogue of the Movie Les Miserables is rhyming with the background music being played. I know it's a musical, so does that means every dialogue has to be sung?
No, it does not mean that all dialog is sung, have a look at Phantom of the Opera, Wicked, West Side Story, etc.
The reason that the movie has all dialog rhyming etc. (known as 'sung through') is because the West End musical that it is based on is sung through (although there are versions where Valjean speaks a normal line to Javert when he gives him his address but this is less usual).
How much of the musical is sung and how much is spoken is down to the taste of the director and his colleagues. Usually the main scenes and emotive moments are conveyed via song (like in Rock of Ages or the Phantom of the Opera) but sometimes everything is in song (like in Les Mis).
As noted by Alfred Cobban in "A History of Modern France" and Phillip Mansel in "Paris Between Empires", it was common in mid-19th-century France for people to sing rather than talk. To quote Mansel: