A Kentucky appellate court on Friday ruled that the Christian owner of a printing shop in Lexington had the right to refuse to make T-shirts promoting a local gay pride festival.

The dispute represents the latest court fight testing the limits of antidiscrimination protections for gays and lesbians following the U.S. Supreme Court’s 2015 landmark ruling legalizing gay marriage nationwide.

The...