An NDA is a contract, not a law passed by Congress. First five words of the 1st Amendment:
> Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.
If you break it, it's a breach of contract, not a criminal act and you didn't break any laws.
Yes, but your example doesn’t work here. The bedrock of what we call our free speech rights is more of a prohibition on Congress from passing laws that impede that. Signing such a contract doesn’t contradict the First Amendment.
It does though because its a contract. There are states which enforces, in their contracts, various anti-boycott measures regarding Israel. These are effectively anti-free-speech clauses and they are imposed by the government. But, are allowed because they are agreed to in the terms of the contract.
> Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances.
If you break it, it's a breach of contract, not a criminal act and you didn't break any laws.