Cut-and-dried espionage isn't a grey area. It's "for the benefit of the public" which can be hard to assess. If a government employee leaked the details of the Osama Bin Laden raid and it subsequently failed, would that be for the benefit of the public? What about leaking the plans of the Union Army during the Civil War? In each case, the answer is not obvious -- the reason that leaking classified information is such a serious crime is that there are extreme, permanent costs to making the "wrong" decision.