A Christian social worker has won an appeal over his claim that he was denied a job because of his biblical views on marriage and sexual ethics.