Azhar Ahmed, wrote on Facebook that "all soldiers should die and go to hell" following the death of six servicemen in Afghanistan. 20-year-old Ahmed, from Ravensthorpe in West Yorkshire said he did not think his comments were offensive.
District Judge Jane Goodwin disagreed, branding his remarks were "derogatory, disrespectful and inflammatory".
He will now do two hundred and forty hours of community service over a two year period and has been fined £300.
More top news
Former Hull FC star Tom Briscoe scored five tries to see Leeds Rhinos retain the Challenge cup with a record 50-0 win over Hull KR.
Labour leadership candidate says Britain playing its role in the migrant crisis would help Cameron secure the promised reforms in Brussels.
The Rhinos lead Hull KR 16-0 at halftime in the Challenge Cup final.