ואין מוסרים להם תינוק ללמדו ספר או ללמדו אומנות דמשכי ליה למינות
Based on this rama (Y”D kuf nun gimmul- aluf)
what is the heter to hire non Jewish/non frum teachers in our schools?
Thank you for your question.
You are bringing up a valid point. The Shulchan Aruch is referring to giving a single child to the gentile to teach, and not when it is in a class setting. Additionally, the Shulchan Aruch writes that in places that the gentile will be punished for doing something to the child, it is permitted. It is possible that a gentile or irreligious teacher in a Jewish school will be very careful what he says because if he starts saying his ideology he will be fired, therefore we are not afraid of this.