Fair point- it may well have not been a violation of his contract. But this legalistic approach misses the spirit of the argument- one holding such a post, particularly with impressionable students as your subjects, ought to prioritise temperance with their social media presence.
If the school did not put this in the contract, this might also be viewed a failing on their part. In the internet age, it would make sense to include such limitations. It is a public post, as such a sacrifice (as to temper your public expression of thought- particularly if it e.g. lacks charity in it’s deliverance) is to be expected.