There are multiple issues here though.
I don’t agree with the teacher being sacked as a result of the picture entering the public domain, but suggesting that sending a sexualised picture of yourself to anyone is a spectacularly bad idea is not victim blaming it’s common sense. Reality is that once you hit send on that picture you lose all control of what happens to it, even if you’ve sent it to a partner, because if the relationship breaks down there is know knowing what will happen to it.
And a topless picture of a woman is different to a topless picture of a man. Let’s be honest here she didn’t send it to him just because, it was to provoke him sexually in ways which a topless picture of a man wouldn’t provoke a woman. If it had e.g.been a breastfeeding picture or similar that would have been different, but then he wouldn’t have had the will to distribute it either.
My ex took topless pictures of me without my knowledge and kept them until we got divorced. I’m sure he didn’t take them just because, esp given he didn’t tell me of their existence until such times as he chose to let me know just how much control he had over me.
The one in the wrong is the man for distributing the picture and she absolutely shouldn’t have lost her job over it. But it’s a valid lesson in why taking naked or half naked pictures of yourself and sending them to anyone is unwise.