The case in question is New York Times Co. v. United States, 403 U.S. 713 (1971). The government cited 18 U.S.C. § 793-794 (otherwise known as the Espionage Act), in particular, section 793(e):
(e) Whoever having unauthorized possession of, access to, or control over any document, writing, code book, signal book, sketch, photograph, photographic negative, blueprint, plan, map, model, instrument, appliance, or note relating to the national defense, or information relating to the national defense which information the possessor has reason to believe could be used to the injury of the United States or to the advantage of any foreign nation, willfully communicates, delivers, transmits or causes to be communicated, delivered, or transmitted, or attempts to communicate, deliver, transmit or cause to be communicated, delivered, or transmitted the same to any person not entitled to receive it, or willfully retains the same and fails to deliver it to the officer or employee of the United States entitled to receive it...The key here is that the government sought to prevent publishing of the documents before it occurred. This is an extraordinary rare restriction of the First Amendment called prior restraint. In Bantam Books, Inc. v. Sullivan, 372 U.S. 58, the Supreme Court said: "Any system of prior restraints of expression comes to this Court bearing a heavy presumption against its constitutional validity." Likewise, the Government "thus carries a heavy burden of showing justification for the imposition of such a restraint." Organization for a Better Austin v. Keefe, 402 U.S. 415 (1971).
The Court in Near v. Minnesota, 283 U.S. 697 (1931) did leave open some exceptions when prior restraint might be acceptable--among them cases involving national security. And this is precisely what the government relied upon in the Pentagon Papers case. However, the Court found in New York Times Co. v. United States that the government ultimately failed to meet this burden, and publication was allowed to continue.
New York Times Co. v. United States was about prior restraint of free speech, not an open invitation to publish any material without regard for any outcomes. Publishers are still subject to issues like libel; and realistically could still be subject to the Espionage Act or other similar laws. Indeed, Justice White's concurrence (jointed by Justice Stewart) said:
[t]hat the Government mistakenly chose to proceed by injunction does not mean that it could not successfully proceed in another way...If any of the material here at issue is of this [classified] nature, the newspapers are presumably now on full notice of the position of the United States and must face the consequences if they publish. I would have no difficulty in sustaining convictions under these sections on facts that would not justify the intervention of equity and the imposition of a prior restraint.Exactly! The burden of the government in these situations would clearly be less than those in a case of prior restraint. On the other hand, this isn't to suggest that the government would inevitably prevail in such a circumstance. Rather, the free-wheeling citations of this case in defense of Wikileaks are misguided precisely because they mistake the holding to be much broader than it truly is.