Leaking the details of classified foreign intelligence operations is considered espionage or treason. Some of those leaks resulted in the execution of informants. Those are not small crimes.
According to the Espionage Act of 1917, he could have been executed. Imprisonment is standard, but 12 years is far better than the maximum of life in prison.