A devout Christian thrown off a university social work course after being accused of posting derogatory comments about gay and bisexual people on Facebook has won the latest round of a legal battle.

Felix Ngole said he was expressing a traditional Christian view and complained that Sheffield University bosses unfairly stopped him completing a postgraduate degree.

A judge ruled against him after a high court trial in London in 2017, but three appeal judges have overturned the ruling by deputy high court judge Rowena Collins Rice.

They said the university should reconsider Ngole’s case.

He said his rights to freedom of speech and thought, enshrined in the European convention on human rights, were breached when he was thrown off the course.

University bosses said he showed “no insight” and the decision to remove him from the course was fair. They said Ngole was studying for a professional qualification and they had to consider his fitness to practise.

Collins Rice ruled that university bosses acted within the law.

She said freedom of religious discourse was a public good of great importance but social workers had considerable power over the lives of vulnerable people and trust was a precious professional commodity.

Lord Justice Irwin, Lord Justice Haddon-Cave and Sir Jack Beatson analysed Ngole’s appeal at a court of appeal hearing in London in March and ruled in his favour on Wednesday.

Ngole said after the appeal court ruling: “This is great news, not only for me and my family, but for everyone who cares about freedom of speech, especially for those working in or studying for caring professions.

“As Christians we are called to serve others and to care for everyone, yet publicly and privately we must also be free to express our beliefs and what the Bible says without fear of losing our livelihoods.”