The argument for publishing from the companies is that this information is not classified, but it's not their decision, it's (basically) the President's.
http://www.fas.org/sgp/crs/secrecy/RS21900.pdf
>The Supreme Court has never directly addressed the extent to which Congress may constrain the executive branch’s power in this area. Citing the President’s constitutional role as Commander-inChief,4 the Supreme Court has repeatedly stated in dicta that “[the President’s] authority to classify and control access to information bearing on national security ... flows primarily from this Constitutional investment of power in the President and exists quite apart from any explicit congressional grant.”5
The President decide's what's classified, the Supreme Court agrees that the President has the constitutional authority to declare things classified. End of story (at least for this case).
I think in general, it's important to note that the Courts have always ruled in degrees. Nothing is absolute (which is why people can get thrown into jail for hate speech), and the courts are the ones that decide up to where the line gets to be drawn, balancing between rule of law and freedom. The discussions about surveillance (and nat. sec. associated) are relevant.