Yes, but the problem is that what is a "matter of national security" in practice is whatever the government says it is. So this exception is enough to effectively eviscerate the freedom of the press.
Nobody got in trouble in the U.S. for reporting on/distributing the Snowden leaks. There weren't any newspaper raids. Nobody was asked to "keep quiet". Anyone who did censor did so out of mutual interest.
Press freedoms have not been eviscerated here. It's a trendy narrative, but in reality you have enormous freedom to distribute content which was illegally obtained as per the Pentagon Papers cases and others. The worst thing we have here is cozy relationships between the media and the government, but alternative news sources are available everywhere and Americans are relying on them more than ever.
Just to be clear, NSLs are largely unregulated by the judiciary and are frequently overbroad in the information they demand, but they aren't arbitrary gag orders.
They can keep you silent about the fact that you got an NSL (and that therefore there's an investigation going on), but not about the content itself.
Press freedoms and freedom of speech haven't been eviscerated in the US, true, but neither is the US the bastion of freedom of speech or press that it's promoted as. It's reasonably free, and has some weird corner cases like Westboro Baptist Church's activities, but it's not head-and-shoulders above its contemporaries.