Soldiers are required to execute the orders of their superiors faithfully and without question or hesitation so they are unable to enter into an NDA of their own free will ( a requirement for executing an NDA )if they are ordered to do so.
Otherwise they are entering into the NDA under duress or due to improper command influence by their superiors.
I seriously doubt such an NDA would be held valid, especially if the information that they were being forced to seal under non disclosure concealed illegal activities or wrong doing or if the NDA restrictions were in place to obstruct justice or frustrate a lawful investigation on a topic that was central to National Security.
If the NDA is interpreted as protecting classified information, then it is certainly valid. If the NDA only serves narrow political ends, then it is probably not valid (small comfort when a corrupt thug like Holder will be the enforcer coming after those who violate any NDA).
If they cleverly redefine Top Secret to “information or material the unauthorized disclosure of which reasonably could be expected to cause exceptionally grave damage to the national government” instead of “. . . exceptionally grave damage to the national security,” then they can make the pretense of classification stick.
Or they can relocate anyone who talks - Gitmo now has five vacancies!