I was wondering what was the idea behind it.
Here are two quotes attributed to Vladimir Lenin, one of the leaders of the Bolshevik revolution and Stalin's predecessor. They will shed some light on this:
Give me four years to teach the children and the seed I have sown will never be uprooted.
Destroy the family, you destroy the country.
So when it came to spreading Communist doctrine, children were vital. Showing oneself as a "Friend of the Children", associating with children and making them very aware of your presence, power and importance as "Dear Leader" clearly played directly into this idea.
Just as importantly, Stalin, and virtually all such tyrannical communist and socialist style leaders, aside from their tyranny itself, were generally guilty of serious crimes against their citizenry. In Stalin's case there were massive purges of political opponents, just to name one of his most famous crimes. See: The Great Purge was a campaign of political repression in the Soviet Union orchestrated by Joseph Stalin from 1936 to 1939.
If so, it was natural that such injustice and cruelty would cause these leaders to be regarded by their people with fear and dread. Cultivating a "Friend of the Children" image was a public relations ploy designed to mitigate such feelings: "Dear Leader is kind and gentle - see how he loves our children!"

Whether or not this aspect is relevant to JawaharLal Nehru I do not know. The question is posted by an Indian - perhaps they know more about this.
As for other leaders solidly inspired by the communist tradition, we might cite Kim Il-sung and Kim Jong-il of N. Korea, although if one examines history carefully, the pattern apparently established by Stalin was virtually ubiquitous among prominent communist leaders, for the reasons stated above.
Re Kim Il-sung: North Korean children were taught in school that they were fed, clothed and nurtured in all aspects by the "grace of the Chairman".
Re Kim Jong-il: At this time Kim assumed the title "Dear Leader" (친애하는 지도자, ch'inaehanŭn jidoja) the government began building a personality cult around him patterned after that of his father, the "Great Leader"

Kim Il-sun and Kim Jong-il with children
Unexplained down-votes are not constructive. Please state your reason - I often edit or even remove posts in response to comments. Questions, answers, and the site at large, are improved thereby.
Hitler was vegan and had obnoxious mustache. What was the reason for this? What other dictators cultivated such a combo?