North Carolina Catholic school can legally fire gay teacher