Teacher accused of sex crimes resigns