Kids' stories often try to explicitly preach a moral. You may not realize it, but in fact every story pushes a message of some kind, even if it's not a moral one. Most of them have countless morals. We just don't tend to notice the uncontroversial ones (eg. killing people is bad / people own the fruits of their labor / unless the government wants them), or the ones that are so well-done that they just sneak in entirely subconsciously. Let me give an example:
Star Wars: A New Hope. A story almost all of us are familiar with. You may think this was a story told for fun and/or to make money rather than to push any specific message, and you may be right, but nevertheless let's see how many questionable ideas I can identify that this story clearly promotes:
When one commands great power, there is no positive obligation to use it for good. Ben Kenobi is a powerful Jedi who can manipulate people's minds and stuff and yet he's living as a hermit on some obscure planet instead of helping the rebellion. None of the other heroes ever even discusses his ignoble inaction, and so most people don't even notice it. The moral is so powerful that it leads people who believe against it to see someone do it and not question them at all. If you didn't realize this slipping in and then went to criticize someone in real life for doing the same thing, you would be inconsistent, and might find yourself questioning your beliefs.
There's nothing wrong with monarchy. Leia is a "princess", which implies something most of us agree is thoroughly unjust, and yet she's on Team Good, with no flaws ever portayed.
Artificial people are property. This one is really shocking given the history of America and how sensitive a lot of our culture is to slavery and racism. Yet none of the audience has any problem when the droids, who are presumably sentient, are abducted and sold by the Jawas, about to have their memory wiped by the hero, or even themselves claim to be the property of humans. Really goes to show the power of fiction as a way to push morals. Just by having none of the goodguys question it, you can show our modern audience a world where an entire class of people have no rights and nobody bats an eyelash. (Albeit, the fans seem to be finally waking up to this one with the release of Solo.)
Battle is not scary. Most of the heroes are more or less ordinary people and never express an ounce of fear when being shot at by a trained army and knowing they could die at any second. I know this isn't strictly a moral, but it's still a potentially harmful message because it downplays the courage of real people who voluntarily enter such situations.
So hopefully I've made the point fairly convincing without spending too much time on it. On to the main point: how to notice and control the morals you insert into your stories. The way I see it, there are six main ways to push a message. The more you use at once, the stronger the message is; but stronger is not necessarily more powerful, as subtlety and presentation are of the essence here.
Something is done or proposed by an otherwise good character
No one questions or criticizes it, or everyone who does is a villain
The action is successful or has good consequences
The victim (if applicable) doesn't complain
Conversely, if even the person who did it ends up regretting it, that's a very strong message that it was wrong
The heaviest method of all: the characters even discuss the idea, some of them being critical, but at the end of the discussion, either everyone is convinced, or everyone who isn't clearly lost the argument.