What makes the ending of the musical so satisfying is that Hill surrenders all of his insincerity and discovers commitment. He is cured of the need for deceit.
The dramatic structure enables us to enjoy his hustling because we see through it, but also have our moral scruples answered towards the end, in the glorious salesman metaphor he uses, saying that, by loving Marian, he's got his "foot stuck in the door" - lovely writing!
Also, the ending is absolutely true to nature: many parents at many school concerts see a special aura of talent around their own child on stage. As in "The Music Man", the phenomenon is both amusing and beautiful all at once - because it is both human and humane.
We all have to be patient with the Harold Hills of this world ... because, too, which of us at one time or another has not overrated ourselves as he did?