Supreme Court rules against 2 teachers at religious schools