State secrets are to governments as private keys are to software engineers, except it's much slower to change meatspace things like (to make up a fictional example) the gaps your military found in their CIWS naval defence system, which if leaked means your enemies now know know how to exploit in order to wipe out your navy.