An Ontario County school district has won an important court decision in its fight to fire a teacher.