Where did you get that information? It seems highly unlikely to me that they were forcing teachers into celibacy, it is sure that they were many nuns in education but especially in later half of 19th century there were many female teachers.
Can you please specify law and your source for that claim.