Plans to establish Canada’s first religiously-affiliated law school hit a roadblock after the nation’s high court ruled last week that the evangelical school could be denied accreditation because of a requirement that students adhere to a “community covenant” barring sex outside of heterosexual marriage.

Trinity Western University’s covenant would deter gay, lesbian, bisexual and transgender students attending, and the legal profession has a right to promote diversity and ensure equal access, the court ruled in a 7-2 decision that has drawn criticism and spurred debate over religious freedom in Canada.