A former head of maths at a private girls' school has been banned from teaching after a panel found he repeatedly tried to access online pornography on school grounds.