The Ugly Duckling is Hans Christian Andersen's Meisterwerk. Apparently he thought so himself, and during his lifetime few would have disagreed. It's survived down the generations.
And I don't like it one bit. Every time I'm exposed to it, I like it less. The Ugly Duckling teaches us that when we are rejected for being different, solace is to be found in leaving those who reject you and taking refuge among 'your own' - forget tolerance and diversity, only 'your people' can appreciate you. The Ugly Duckling does nothing to earn his victory at the end; there is no struggle against a foe or against the odds, it's merely that nature takes its course and he becomes what he always was. Which is no story at all, really. There's no reason to like the Ugly Duckling.
The idea of someone ostracised for looking different having the last laugh is a beautiful one. But in a world where people 'look different' amazingly often, the 'last laugh' isn't all that funny, really.