OTTAWA -- Requiring a person to behave contrary to their sexual identity is "degrading and disrespectful," the Supreme Court of Canada said Friday in ruling that law societies have the right to deny accreditation to a proposed law school at a Christian university.

In a pair of landmark decisions, the high court said law societies in Ontario and British Columbia were entitled to ensure equal access to the bar, support diversity and prevent harm to lesbian, gay, bisexual, transgender and queer students.

The cases pitted two significant societal values -- freedom of religion and promotion of equality -- against one another.

Trinity Western University, a private post-secondary institution in Langley, B.C., was founded on evangelical Christian principles and requires students to adhere to a covenant allowing sexual intimacy only between a married man and woman.

Law societies overseeing the profession in Ontario and British Columbia said they would not license graduates from Trinity Western because the covenant amounts to discrimination against LGBTQ people.

The Court of Appeal for Ontario had upheld the rejection, while B.C.'s top court sided with the university.

In each case, the Supreme Court ruled 7-2 in favour of the respective law society. Among the seven, several different sets of reason were provided.

A majority found that the decisions to deny accreditation were reasonable because they appropriately balanced the interference with the charter right of freedom of religion and the public-interest objectives of the law societies.

In the decision concerning Ontario, five Supreme Court justices said the province's law society interfered only with the university's ability to operate a law school governed by the mandatory covenant.

"This limitation is of minor significance because a mandatory covenant is not absolutely required to study law in a Christian environment in which people follow certain religious rules of conduct, and attending a Christian law school is preferred, not necessary, for prospective TWU law students."

On the other side of the scale, "it is inimical to the integrity of the legal profession to limit access on the basis of personal characteristics," the judges wrote. "This is especially so in light of the societal trust enjoyed by the legal profession.

"The reality is that most LGBTQ individuals will be deterred from attending TWU's proposed law school, and those who do attend will be at the risk of significant harm."

In the decision concerning B.C., the same five justices said being required by someone else's religious beliefs to behave contrary to one's sexual identity is "degrading and disrespectful" and "offends the public perception that freedom of religion includes freedom from religion."

Janet Epp Buckingham, a Trinity Western professor who helped develop the law school proposal, expressed disappointment.

"This is something that has been a dream of mine for 25 years," she told reporters in the foyer of the Supreme Court building.

"We will not be starting a law school in the near future, and we will have to consider our options to determine how we're going to go forward with this."

Earl Phillips, executive director of the proposed school, added in a statement: "All Canadians should be troubled by today's decision that sets a precedent for how the courts will interpret and apply charter rights and equality rights going forward."

Trinity Western proposed the law school in 2012 and received approval to open from the Federation of Law Societies of Canada and the province's Ministry of Advanced Education. However, the ministry later withdrew approval.

The university wanted to ensure its graduates would be eligible to be called to the bar throughout Canada, and therefore applied to the provincial law societies for accreditation of the planned school.

Six law societies -- Alberta, Saskatchewan, Manitoba, New Brunswick, Prince Edward Island, and Newfoundland and Labrador -- have granted accreditation. Nova Scotia's law society refused accreditation, but the decision was overturned in the courts.

In Ontario, the benchers of the Law Society of Upper Canada -- since renamed the Law Society of Ontario -- denied accreditation to the school in a 28-21 vote.

In reviewing the decision, an Ontario court found the society had undertaken a reasonable balancing of the protections at issue. The ruling was upheld on appeal.

British Columbia's law society denied recognition to the school on the basis of a binding referendum of its members. The reviewing court ruled that the process ignored an obligation to consider the competing rights at play, and set aside the law society's decision. An appeal court upheld the ruling.

The Ontario and B.C. law societies each issued statements welcoming the Supreme Court decision.

Said Paul Schabas, treasurer of the Ontario society: "It is an affirmation of the critical work we have done and continue to do to promote equality, diversity and inclusion in the legal profession."