I'm going to play devil's advocate a bit here, and point out at least in the US, that there's a legal term called "bona-fide occupational qualifications" (or BFOQ). What it basically means is that, even though you can't discriminate as an employer against things like race, sexuality, religion, gender, and so on, you can ignore that rule if whatever that discrimination is about is a bona-fide requirement of the job. For instance, a strip club can discriminate against hiring a male dancer, or a church can discriminate against hiring an atheist priest.
So, the question is, does such a qualification extend to a teacher at a Catholic school, and would orientation (and an existing partnership) count as a BFOQ? For the second, I'm actually going to say yeah, it can, because even though religion gets a lot of flak for it (deserved flak, I'll add), I don't agree with forcing them to hire someone that doesn't fit their standards set by their religion (or at least, set by their interpretation of their religion - I think the bible has things to say against, say, shaving your beard that most clergy happily ignore, but that's another topic). Now, would that requirement extend to a teacher at a Catholic school? ...Maybe? Honestly, I don't know, as I've never been to one, and don't know anyone that has.
That being said however, the school should not be allowed to fire him based on those grounds if they originally hired him knowing it. I think it would be reasonable for them to say "no, we can't hire you because of your marriage to another man", but to specifically say they'll hire him and ignore that, then turn around and fire him for the same reason, should not be allowed.