I found that exceptionally uncomfortable to do as well – and while I’m not going to go into details some men might describe what I saw as their type of dream come true (and if it had been a dream, I might have been one of them). But the point is, whatever my reaction, my motiviation was correct, and the outcome was correct. And that’s much more important than what’s going on in your head.
Any teacher who ever administered corporal punishment to a child whose primary motivation was their own selfish sexual pleasure – well, this is an occasion where my views coincide very strongly with Biblical teaching – Mathew 18:6 to be precise. It is a monstrous, evil, act for a teacher to ever do anything involving a child with the intention of getting sexual pleasure out of it.
However, I do think this is different from a situation where a teacher – discharging their duties in the way they would anyway – finds themselves in a situation where they have feelings about what they are doing that are not the reason they are doing it, and that they would much rather not have.