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 lack of action, and so the story sends the message that that is okay. And one of the most telling symptoms is that so many people don't even notice it. The moral is so powerful that it leads someone who believes against it to see someone do it and not even 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 is a title associated with 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 nobody 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, people in power seem to be waking up to this one judging by 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.
For interest's sake, I'll go ahead and explore some examples of these techniques in my own novel, Pillars of Life. All of these were thoroughly intentional at the time.
In the end of the novel, Jaydin and Nayomi discuss what to do with the world, now that they're basically omnipotent. They decide to use their power essentially as Anarchist vigilantes. It doesn't even occur to them to institute a democracy. The moral is a little weaker than I'd like it to be since they never saw an example of democracy to give them the idea. Methods 1 and 2 are used.
In chapter 4, the rebel children decide to try and steal some food from the government, mostly just as a symbolic defiance. This is respecting the moral value of Agency. Since they even end up convincing Nayomi to join them, it sends the message that this is right, since she is generally the stolid, prudent one who would be the most opposed to such a reckless plan. It also works out well. Methods 3 and 6 used (I don't count method 1 because it was originally proposed by Mitilda, who is clearly portrayed as erring on the side of recklessness).
This one was super clumsy in retrospect; I'm a lot less keen to defend the action as presented than I was at the time, and the real reason it was a good idea is because there's a very good argument that it was in fact strategically better, not just a symbolic defiance.
The discussion of the metaphysics of the soul in chapter 9, prompted by a discussion about the moral ramifications of the realization that we don't actually know what happens to people after they die (that was before I had figured out what I now have about the metaphysics of sleep; I probably wouldn't have written this scene if I had understood that). This is the heaviest one as it thickly employs the final technique I listed above, but I kept out of the deep end of my beliefs. I stuck to simply defending the idea that people's souls can exist without their bodies. Methods 1 and 6 used.