An Alabama teacher who has been charged with sex crimes is contesting a school district’s effort to fire him.