A Massachusetts judge has ruled against a Catholic school that refused to hire a gay man because of his sexuality, saying the school violated the state’s anti-discrimination law, The Associated Press reports.In July of 2013, Matthew Barrett was offered a job as the food services director at Fontbonne Academy, an all-girls Catholic school in Milton, MA. When he filled out his employee paperwork, for his emergency contact, he wrote his husband’s name and their relationship. Two days later, the school rescinded the job offer. According to The Boston Globe , Barrett said the school’s excuse was that “the Catholic religion doesn’t recognize same-sex marriage,” so they couldn’t hire him. Barrett sued , charging that the school had discriminated against him on the basis of his sexual orientation.The Massachusetts law that prohibits discrimination based on sexual orientation has been in effect since 1989. It forbids discrimination in the areas of housing, credit, services, and employment. While religious institutions are sometimes exempt, the judge ruled that the exemption does not apply in this case, as the school is not exclusively Catholic. Fontbonne Academy enrolls students of all faiths, and employees are not required to be Catholic.In a statement issued by GLAD , which represented Barrett in court, Barrett said he was "ecstatic" at the ruling. “What happened to me was wrong, and I truly hope it doesn’t happen to anyone else.”