Hitler spoke often about the need to prepare German youth for the "movement." Here is a quote from one of his speeches. Eventually, the Hitler Youth program was started, and the indoctrination of young people became a big part of his efforts. I also think that soldiers seeing children marching produces a psychological effect of a desire for protection and a feeling of responsibility, which would help with the soldier's moral for fighting. Here's the quote from https://store.tabblo.com/studio/stories/view/109115/:
"Regardless of whatever we create and do, we shall pass away, but in you, Germany will live on and when nothing is left of us you will have to hold up the banner which some time ago we lifted out of nothingness. (applause) And I know it cannot be otherwise because you are flesh of our flesh, blood of our blood, and your young minds are filled with the same will that dominates us. (applause) You cannot be but united with us. And when the great columns of our movement march victoriously through Germany today I know that you will join these columns." - Hitler
Nazi Germany had an obsession with youth and indoctrinating the young. The "Hitler Youth" were a group of young people devoted to National Socialism and the Nazi party. The children were likely there to show the passion of the young people and to make the parade look better to the audience of families, etc.