I would think the code the teacher agrees to would be the code and law of the Catholic Church.
Ohio had a case that to me seems similar, a teacher in a Catholic School, married and I believe with children put out pro-gay-marriage tweets and was terminated for that.
This is that story: http://www.lifesitenews.com/news/ohio-catholic-school-fires-teacher-who-plans-gay-marriage-diocese-wholehear
My error, this seems to be a different story but from Ohio, still a similar situation.
Here is the one I was looking for from Ohio as well and it was on facebook.
“A Catholic school administrator from Ohio was fired earlier this week after the Archdiocese of Cincinnati found that he was openly supporting same-sex marriage on his personal blog.
“My point was I wish I had time to care who married each other but I don’t,” Mike Moroski, a 34-year-old teaching veteran from Purcell Marian High School, told ABC News in an interview.
The Archdiocese of Cincinnati apparently sent a letter to teachers and parents explaining why they terminated Moroski’s employment, arguing that support for same-sex marriage stands in conflict with Roman Catholic Church doctrine, which teaches that homosexuality is a sin.
According to ABC, Moroski, who is married to a woman and identifies as a Catholic, stirred up debate on his Facebook page when he posted a quote from President Barack Obama’s inauguration speech supporting same-sex marriage.”
Also:
“Cincinatti.com revealed that as part of his job, Moroski was required to sign a contract every year where he pledged to “comply with and act consistently in accordance with the stated philosophy and teachings of the Roman Catholic Church.”