Actually the legend (some argue is true, though likely it isn't) came from Penny Dreadfuls in the 19th century where Sweeney was the antagonist to some young hero that needed to be saved or was saving his lady love. It was Christopher Bond who in 1973 re-envisioned the story to be a psychological melodrama that had you root for the serial killer and turn it into a story of revenge, tragedy and the consequences of living in the past.
Sondheim loved it and thought it'd be great as a musical because the musical would give it an epic/operatic grandiose quality that a small drama does not. Sweeney's motivations and thoughts seem sweeping and heartbreaking with music as opposed to just pure insanity without. It also allowed him to make a horror musical, something Sondheim wanted to do and try and scare or at least disturb the audience with music (the Ballad of Sweeney Todd and the random screeches of a whistle were these tricks, all removed from the movie) and he infused it with a crap ton of dark comedy (any scene with Mrs. Lovett and many without).
So while it has worked without music, its musical form is the most captivating and the definitive form people think of when they hear "Sweeney todd." It has graphed an iconography and character to the name and myth stronger than centuries and gurgional theater, penny dreadfuls, horror movies and regular plays.
Also, to say Sondheim's music is bad makes you look a few body parts short of a meat pie, so you might want to avoid that in the future.