Bruce Rankin (58) molested one victim while she lifted weights.
He admitted making a sexual remark to the girl and handling her body at the school which cannot be named for legal reasons.
The assault happened between August 2012 and June 2013 when the girl was aged 14 or 15.
Rankin’s not guilty pleas to charges alleging he touched another female pupil, made a sexual remark to another and watched two girls getting changed in a female changing room were accepted.
Rankin, of Whiteshaw House, Strathaven, admitted sexually assaulting two other girls at other locations. One of those assaults happened in a church hall.
Hamilton Sheriff Court heard Rankin looked to have escaped with a written warning from North Lanarkshire Council after the assault on the school pupil.
He retired the following year, but was charged after the other allegations came to light.
Defence agent Marco Guarino said his client accepted “full responsibility”, adding: “Nothing I say should belittle the gravity of it in any way.
“He is aware of the effect his conduct has had on his victims and continues to pray for them, given he is a deeply religious man.
“He has been ostracised in his tight-knit local community. He had been a man of some standing in both his professional and personal life, but has had to withdraw from that.”
Sheriff Shiona Waldron, who put Rankin on the sex offenders’ register for 10 years, told him: “While the offending is at the lower end of the scale, it is still a very serious offence and my view is that this type of offending must attract nothing other than a custodial sentence.
“You were in a position of trust as a teacher and the offences all involved children.”
The case drew a response from NSPCC Scotland whose spokesman said: “Rankin held a position of trust over children as a teacher but carried out a series of attacks on his young victims.
“Abuse can ruin childhoods and the impact can last long into adulthood. It is vital his victims are now given the support they need to overcome the crimes inflicted on them.”