The comments accompanied an image on Twitter of Tyne Cot British and Commonwealth War Cemetery in Ypres, Belgium, which contains 11,954 graves from the First World War.
The caption posted by the unnamed teacher at Kilwinning Academy in North Ayrshire read: "Great fun, kids a pleasure, great banter! #proud #trenches2014."
The message was removed shortly afterwards and replaced with an image of the trenches with the words: "Very humbling."
North Ayrshire Council said the original tweet had been inappropriate and apologised.
But Jan Cunningham, club secretary of the Royal British Legion Scotland's Irvine branch, said: "It was an inappropriate thing for a member of staff to say in such a situation.
"I'm all for children being made aware of what happened at that point in history in order to learn from the past and teach future generations.
"But the Twitter message was a blunder and out of order."
The pupils visited preserved trenches in Flanders, where British forces suffered 7960 killed, 29,562 wounded and 17,873 missing in the First Battle of Ypres in 1914. A further 59,275 casualties followed in the second battle in 1915.
A council spokeswoman said: "We would like to apologise for any offence caused by this inappropriate tweet.
"The pupils have been extremely enthusiastic throughout their work on World War One in this historic year.
"The impact of the war has been made all the more real for pupils during their visit to the battlefields of France and Belgium.
"There is no doubt the trip has added to the respect they already had for those who lost their lives in the trenches."
Every secondary school has been offered £2000 to carry out educational visits to European battlefields as part of the Scottish Government's plans to commemorate the centenary of the First World War.