A teacher who took pictures of his genitalia on school grounds during the day has been banned from the profession for life.