A teacher at a Hampshire secondary school has been banned from teaching after allegedly sexually assaulting a pupil.