A UK court has ruled that a university's decision to expel a Christian student over his comments on homosexuality is legal.

In 2015, Felix Ngole wrote on his personal Facebook page that "same sex marriage is a sin whether we like it or not. It is God's words and man's sentiments would not change His words."

He went on to add that "the Bible and God identify homosexuality as a sin."

Ngole, who was studying social work at Sheffield University, was immediately expelled for the comments.

The 39-year-old student challenged the university's decision arguing that expelling him was a breach of his human rights.

The university had a different view. While officials from Sheffield University agreed that Ngole "was fully entitled to his religious beliefs, and had acted with honesty and integrity," it was his decision to make his views public that was in question. They argue he "may have caused offence to some individuals."

READ: Check Your Faith at the Door: Kentucky Judge Resigns Over Gay Adoption

A UK court agreed with the university's position, claiming Ngole's public comments on homosexuality "could be accessed and read by people who would perceive them as judgmental, incompatible with service ethos, or suggestive of discriminatory intent."

"That was a problem in its own right," the court ruled. "But whatever the actual intention was, it was the perception of the posting that would cause the damage. It was reasonable to be concerned about that perception."

Ngole disagrees.

"To me it sends a chilling message that if you are a Christian and you hold traditional Christian views you should be careful not to express them because you might end up losing your job," Ngole said shortly after the ruling.

Andrea Williams, chief executive of the Christian Legal Centre, is representing Mr. Ngole. She released the following statement:

"The court has ruled that though Mr Ngole is entitled to hold his Biblical views on sexual ethics, he is not entitled to express them. But freedom to believe without freedom of expression is no freedom at all."

"Many views are frequently expressed by students on social media and in other contexts. It is the expression of Biblical morality that has been singled out for sanction by the university."

"This ruling will have a chilling effect on Christian students up and down the country who will now understand that their personal social media posts may be investigated for political correctness."

Ngole, who is from south Yorkshire, was removed from Sheffield University's two-year MA program last February following his Facebook comments.

"I am very disappointed by this ruling which supports the university's decision to bar me from my chosen career because of my Biblical views on sexual ethics," Ngole said in a statement. "I intend to appeal this decision which clearly intends to restrict me from expressing my Christian faith in public."

And Williams said, "Rulings like this show that society is becoming increasingly intolerant of Christian moral values. Christians are being told to shut up and keep quiet about their moral views or face a bar from employment."

"Unless the views you express are politically correct, you may be barred from office. This is very far from how a free and fair society should operate," Ngole added.

READ: 'Let There be Light': Sean Hannity Stands for Christianity with New Film