Warren Butler was handed a 16-week sentence, which was suspended for 18 months, and he has been ordered to complete 250 hours of community service for posting an offensive message online about Mikaeel Kular who was found dead in Fife in January.
Grenadier Guard Butler, who is based at Aldershot barracks in Hampshire had admitted improper use of a communications network at an earlier hearing.
The 19-year-old, who was drunk at the time, wrote abusive words about the little boy, adding "one down many more to go".
Within five minutes of him sending the message about Kular, it went viral leading to Butler and several of his relatives receiving death threats.
Also Read
District judge Phillip Gillibrand said, "People were appalled at seeing this sort of prejudice. It was cruel, disrespectful, and completely unjustified. You have much growing up to do".
"To post this Facebook entry with you standing there in full ceremonial uniform was a great disgrace, and brought the army into disrepute," the judge said.
He said the army was still to decide what disciplinary action to take. Butler must also pay 85-pound costs and an 80-pound victim surcharge.
Mikaeel's body was found in woodland in Fife on January 17, the day after he was reported missing from his home in the Drylaw area of Edinburgh.
His 33-year-old mother, Rosdeep Kular, has been charged with his murder.