A pastor and school caretaker caused widespread offence with a tweet which claimed that Pride events were "harmful to children", a tribunal has heard.
Isle of Ely Primary School headteacher Helen Davies described the June 2019 comments, which coincided with the first Cambridge Pride festival, as an "unprovoked attack."
The subsequent investigation and disciplinary action against Keith Waters was "never, ever, ever" about his religion, she said.
Mr Waters, 55, quit his job as a caretaker at the Cambridgeshire school after the tweet because he said it had become "untenable."
He is claiming direct and indirect discrimination and constructive dismissal against the Active Learning Trust, which runs the school, and against Ms Davies.
At the tribunal, Ms Davies said that Mr Waters "had broken the policies."
"Anyone who had tweeted something - it doesn't matter who they are, what their role is, what their beliefs are - if they tweet something that actually then causes offence and brings the school into disrepute, they have broken the codes of conduct and the policies that exist within the school," she said.
"It doesn't matter whether I agreed with him or didn't agree with him, the point of the disciplinary is 'were these codes of conduct broken?' and that is it.
"It was never, ever, ever about his religion. It was that it broke our codes of conduct and that was what I was investigating," she added.
Mr Waters, of Ely, who has been an evangelical church minister for up to 15 years, had tweeted: "A reminder that Christians should not support or attend the LGBTQ 'pride month' events in June.
"They promote a culture and encourage activities that are contrary to Christian faith and morals. They are especially harmful for children."
'Attack on the LGBTQ community'
Addressing whether she thought at the time that the tweets were homophobic, Mrs Davies said she understood that people were offended and she understood how and why they were offended.
"I would say that it appears from the words that are in the tweet that it is an attack on the LGBTQ community, an unprovoked attack, and it says the events they hold are harmful to children."
School policies say staff must not post things on social media which cause offence, the tribunal heard.
Mrs Davies said that whether people were right or wrong to be offended was "immaterial".
She added: "It brought that kind of thinking into the school. The school did not ask for that. It did not condone it but we were brought into [this situation] by association."
Mr Waters' views were branded "extremist", "abhorrent" and a "disgusting outburst on a very public platform", in three complaints to the school, but he says his comments were in line with his conservative Christian beliefs.
Mrs Davies said she had also fielded telephone calls about the controversy and a "cascade" of concerns were raised about the matter online.
Reaction to the post included a local Liberal Democrat councillor calling for an apology.
Pastor 'received death threats'
The original tweet provoked negative publicity, in the local press and online, and the school had to investigate because it received complaints from parents. Mr Waters worked part-time as a caretaker at the school from January 2017 and resigned in June 2019, weeks after posting the now-deleted tweet.
He said his aim with the tweet had been to warn Christians about LGBTQ Pride events as they may involve nudity, people in sadomasochistic outfits, and displays of an overtly sexual nature.
The tribunal heard the complaints to the school included unfounded allegations linking Mr Waters to child abuse, inciting people from other faiths and calling for violence against supporters of the Pride festival.
Mr Waters was stopped from working at the school gates amid mounting hostility in the local community and after telling Mrs Davies he had received death threats. She told the hearing: "He did say to me that there had been an extreme amount of hostility to him in the wider community. He told me had death threats.
"He was telling me he received death threats. He was saying that people had arrived at his house. It would not have been rocket science for somebody to have worked out that he worked at a school.
"Our community in Ely is quite small and it would have been known that he would be likely to be [working on duty] on the gate. I can't take that risk."
Mr Waters felt unable to do his job fully or talk about what was happening to the children or the parents. He handed in his notice and attended a disciplinary hearing that resulted in afinal written warning, against which he appealed unsuccessfully.
Mrs Davies told the hearing the school's actions taken against Mr Waters were proportionate and that she was "absolutely" certain details about the investigation were not leaked.
The hearing was adjourned to Thursday.