A primary school maths teacher who hacked into a colleague’s phone and found an intimate video of her before trying to send it to himself on WhatsApp has been banned from teaching.