State appeals court rules religious doctrine used to convict priest of sexual misconduct