When can an NDA be legally broken?

There are many reasons that a contract can be void or voidable. Wikipedia will give you a good rundown. The reasons which apply to contracts generally will apply to NDAs specifically. This answer focuses on non-disclosure agreements.

Various legal authorities and courts have found contracts to be void in the following circumstances:
1. Crime
2. Torts
3. Public safety
4. Public Health
5. Matters of substantial public concern

The Model Penal Code prohibits what it calls compounding. The crime involves accepting payment in exchange for not reporting a crime.