D&D provides no moral compass at all. Few games systems do, and many that do provide moral compasses within thier mechanics provide fairly frightening ones.
It is up to the game master (and to a lesser extent the players) to provide a moral compass.
If one is not provided, generally it is the same as D&D teaching immoral lessons, as EN said. Younger DM's in particular are generally poorly suited to providing a moral compass for D&D as a well developed understanding not only of right and wrong but of cause and effect is required.
I think we as RPer's tend to underestimate the influence RPG's can have, especially over the young. Many of us that have been playing the game 20 years can remember people breaking down into tears when characters died, and real friendships being broken by things that occured in a game, and even the occasional violence breaking out among young players (by which I mean high school age and younger). We think of RPG's as 'just a game', which is fitting, but I think somewhere in the back of a RPer's mind he should have a little caution sign that reads 'Caution: Unsupervised Amatuer Psychotheraphy Being Used as Recreation. Keep Your Mind Guarded and Don't Take It Too Seriously.'
For these reasons, I would never allow anyone but myself to DM my own small children. I would never allow my children to play an RPG with anyone that I didn't know, and would prefer that they regularly met at my house so I could occassionally keep an eye on how things were developing. I think this is reasonable for any sort of activity, but it goes double for RPG's.