Is discrimination ever ethical? What if it is rooted in religious convictions? Is it unethical, for example, for a Christian school to refuse to hire an atheist teacher?

Is discrimination ever ethical? What if it is rooted in religious convictions? Is it unethical, for example, for a Christian school to refuse to hire an atheist teacher? Is it unethical for a business owner who believes that homosexuality is contrary to God’s will to refuse to hire someone in a same-sex marriage?