I think an overt moral lesson (such as don't take other people's things, or be yourself even if that is different from those around you) can flatten an illustrated story. Recently I saw the children's author and illustrator Peter Brown (Chowder, Creepy Carrots) speak about his creative process. One of my clever colleagues asked him about moral messages in children's books. His answer surprised me. He said each of his books contains a message and teaches a lesson.
Mr. Brown cited Maurice Sendak as an influence and I think that Sendak's attitude was different. His wild rumpus was an overdue antidote to preachy adult controlled books for children. His revolutionary work focused on children as they often are (messy, mean, willful) instead of as we would like them to be (polite, receptive, tidy). Max does not, to my mind, learn a lesson on his adventure.
Two authors have recently grappled with overtly moral tales in absorbing chapter books for middle grade readers. Both Grace Lin (Starry River of the Sky) and Adam Gidwitz (In a Glass Grimmly) have fashioned stories of depth and ambiguity out of lessons similar to Brown's (don't take other people's beautiful gifts from the emperor) and (be yourself, not what other people want you to be. Or you'll die.) Part of the books' success lies in their excellent writing. Lin builds a beautiful tale with believable characters that seems quiet and real among the fantastical elements. Gidwitz plays at gruesome middle grade horror worse than any Goosebumps but his language and narrative surprises give this page turner depth and feeling.
Brown pays homage to dozens of old movies and TV shows, especially The Twilight Zone. By borrowing from longer works, he gives the short book a depth that otherwise would be difficult to achieve. Both Lin and Gidwitz borrow from age old stories for dimension and inspiration. As a reader, I don't like to be preached at but I love a heroes journey, deftly told. Dear authors, feel free to borrow and steal as needed to add layers to a short well told tale. And, like Brown, Lin, and Gidwitz, be honest about it.