Who would have guessed that the dude who wrote "The Ugly Duckling" and "The Emperor's New Clothes" had some strong opinions about appearances? You, probably. Andersen seems to be trying to teach us that we shouldn't pay too much attention to appearances, since vanity is a tool of the Devil. But at the same time, he seems to think it's okay to be drawn to beauty, since God inspires artists, and He created nature to be beautiful. Hmm, way to contradict yourself, Andersen. Maybe if you can learn to appreciate beauty and art for what they are, but are not seduced into forgetting what's actually important—like loving God and all that jazz—you can get Andersen's stamp of approval. Maybe.
Beauty doesn't last, so, really, it's not all that important.
Don't judge a book by its cover, unless it's a really lousy book.