A former headteacher of a primary school who made inappropriate and abusive comments about pupils and staff has not been banned from teaching.