A GCHQ intern put the UK’s national security at risk when he downloaded top secret data onto his phone and took it home.