Teacher resigns after parents claimed he would ‘teach children to be gay’