How do you know it's the head who decided that you were having an affair?
Step back from the situation. Look at it from the outside. You know you had no intention at all. That's fine.
But maybe there was a point that you perhaps burst into tears and he was seen comforting you?
Do you perhaps "gush" a little in your emails which could be misinterpretted? "Oh you're so wonderful, I'm so glad my dc has you. Looking forward to seeing you..." Even a "xx" on the end (which some people do standardly) could be looked sideways on to someone already suspicious.
Maybe he felt that you were getting emotionally attached to him. Maybe he felt he was getting emotionally attached to you.
Maybe a fellow parent heard that you were talking regularly and started rumours.
Maybe a/your child said something that's been misinterpretted. "My mum said she thinks you're brilliant, just like my dad..." them meaning their dad was brilliant. He takes it to mean you are thinking of him as replacing their dad.
What they did was step in to protect the teacher, you and your dc. If there were rumours, or a suspicion, then they are right to do this and make sure you and the teacher cannot be put under suspicion, it could ruin his career, your marriage and cause a lot of upset people, just from a rumour that won't go away.
I'm not sure how you deal with it though. If you rush into the head's office denying it, then either he won't know about it-in which case you'll look a bit crazy, or he does, in which case your denial will look as bit of "my thinks he doth protest too much".
If you demand to talk to the teacher alone, then it could look like you are emotionally involved and proof of the affair. If you ignore it, you feel your dc is being compromised.
I think your best thing to do is to leave it for the rest of the year and hope you get a woman next year
. Seriously go in at the start of the year and ask if you can discuss communication and how best to support your dc that year.