A primary school headteacher who was sacked after having sex with two 17-year-old boys he met through a gay dating app has been awarded nearly £700,000 compensation by a tribunal.

Matthew Aplin, who worked at Tywyn primary school in Sandfields in Port Talbot, south Wales, had sexual activity with the teenagers at his home in August 2015.

The school governors were concerned about safeguarding issues and held a meeting with the local education authority, after which an investigation was launched. Aplin was suspended and a disciplinary hearing led by school governors was started.

He was accused of “behaviour bringing the school into disrepute, conduct incompatible with the role of the headteacher both which seriously undermined the trust and confidence of the school in its headteacher”.

The disciplinary panel, assisted by local education officers, dismissed Aplin in May 2016.

He took the school to an employment tribunal, claiming unfair dismissal and sexual-orientation discrimination. Aplin won, but the decision was appealed against by the school at the employment appeals tribunal – but it upheld the original decision.

The tribunal ordered the governing body of Tywyn primary school to pay Aplin more than £696,000.

“His career shows the claimant to be an individual who was dedicated to working in the education sector and someone who was not only ambitious but effectively so,” the tribunal said. “The claimant was therefore a well-qualified and experienced school manager with extensive teaching experience.”

The tribunal also criticised the governors for “acquiescing” to the wish of the local education authority to dismiss Aplin.

“The panel had no understanding of the reasons given for dismissal, the tribunal drew the conclusion that the panel decided upon dismissal but were entirely reliant on the LEA advisers for its reasoning,” the tribunal said. “In short, they saw that the LEA appeared to want a dismissal and acquiesced in that.”

The tribunal said Aplin would not have been treated differently by the governors if he was heterosexual. “The decision-makers did not feel competent to address matters and wanted to rely on the ‘experts’,” the tribunal said.

“Had the presentation of the case against a comparator been carried out in a similar fashion, we are of the view that the decision-makers would equally have abdicated responsibility to those who they saw as having the expertise and qualifications to make the relevant decisions.”

The tribunal also noted that Aplin found it difficult to obtain new employment close to his home, which he believed was because he was being “deliberately undermined”.

Since September last year, he has been working as a teacher at a primary school in the Merthyr area on a series of temporary contracts, the tribunal said.

The ruling added: “We came to the conclusion that given his existing experience he would be likely to return eventually to a headteacher role and that he would do so more quickly than he did previously because of his experience.

“Doing the best that we can, we view that this would take up to 10 years. We do not consider that there is a significant prospect that the claimant would become unemployed although the current role is temporary that has been extended on a number of contracts.

“This reflects how well the claimant is thought of and points to a continuation of employment or a very favourable reference at the least. We concluded that he would progress through leadership roles to reach the position of headteacher.”