Civil libertarians said the ruling was the Court’s first against the C.I.A. in a case pitting civil liberties against national security concerns. They said it was an important affirmation that the Court would not defer to any and all executive branch actions taken in the name of national security.  –Stuart Taylor, Jr.,
No, not Bradley Manning, Edward Snowden, drone policy, or anything else of such recent ilk. Instead, let’s take a trip down memory lane.
“John Doe” was a CIA employee in good standing who told another employee he was gay in 1982. What followed, according to the Supreme Court opinion (486 US 592):
Almost immediately, the Agency placed respondent on paid administrative leave pending an investigation of his sexual orientation and conduct. On February 12 and again on February 17, respondent was extensively questioned by a polygraph officer concerning his homosexuality and possible security violations. Respondent denied having sexual relations with any foreign nationals and maintained that he had not disclosed classified information to any of his sexual partners. After these interviews, the officer told respondent that the polygraph tests indicated that he had truthfully answered all questions. The polygraph officer then prepared a five-page summary of his interviews with respondent, to which respondent was allowed to attach a two-page addendum.
On April 14, 1982, a CIA security agent informed respondent that the Agency’s Office of Security had determined that respondent’s homosexuality posed a threat to security, but declined to explain the nature of the danger. Respondent was then asked to resign. When he refused to do so, the Office of Security recommended to the CIA Director (petitioner’s predecessor) that respondent be dismissed. After reviewing respondent’s records and the evaluations of his subordinates, the Director “deemed it necessary and advisable in the interests of the United States to terminate [respondent’s] employment with this Agency pursuant to section 102(c) of the National Security Act . . . .” Respondent was also advised that, while the CIA would give him a positive recommendation in any future job search, if he applied for a job requiring a security clearance the Agency would inform the prospective employer that it had concluded that respondent’s homosexuality presented a security threat.
What is this section 102, paragraph c? The 1947 act that created the CIA (and made other changes to the military and intelligence apparatus) permitted the director “in his discretion, [to] terminate the employment of any officer or employee of the Agency whenever he shall deem such termination necessary or advisable in the interests of the United States” (http://www.oup.com/us/companion.websites/9780195385168/resources/chapter10/nsa/nsa.pdf). Later Eisenhower, by Executive Order 10450 (http://www.archives.gov/federal-register/codification/executive-order/10450.html), would make “sexual perversion” an example of immoral or criminal conduct, and thus, grounds for dismissal from any federal job. This order, however, had been repealed at least as a blanket policy toward homosexuality by 1982. Hence, Doe thought he had a reasonable chance in the courts because he was 1) denied due process (a chance to fight his dismissal) and 2) deserved equal protection under the law (dismissed for being gay and not disclosing it, while being heterosexual and not disclosing it didn’t matter), and 3) had economic harm from the government’s action (lost job).
When Doe sued, he initially was told the law precluded his right to sue. He appealed, and when the case reached the Supreme Court in 1988, he won not his job, but the right to keep suing when the Court ruled that he was allowed to argue his case in court, so the lower court had to listen again. Scalia dissented: “Neither the Constitution, nor our laws, nor common sense gives an individual a right to come into court to litigate the reasons for his dismissal as an intelligence agent” (http://caselaw.lp.findlaw.com/scripts/getcase.pl?court=us&vol=486&invol=592). (You can read the case many places, but there’s an audio version here: http://www.oyez.org/cases/1980-1989/1987/1987_86_1294)
Of course, the review still might not work in Doe’s favor.
The case went back to the DC District Court, but Doe ultimately lost in 1993 when the case went to the Court of Appeals (https://bulk.resource.org/courts.gov/c/F2/981/981.F2d.1316.91-5249.html) The court in its case cited, among other examples, Padula v. Webster:
822 F.2d 97, 104 (D.C.Cir.1987) (“It is not irrational for the [FBI] to conclude that the criminalization of homosexual conduct coupled with the general public opprobrium toward homosexuality exposes … even ‘open’ homosexuals to the risk of possible blackmail to protect their partners, if not themselves”).
Thus, he was a legitimate security risk by virtue of sexual orientation, and thus, the law clearly permitted his dismissal.
The question harkens to today: how do we grant any power of discretion when necessary yet prevent its abuse?
 “Dismissal of Gay C.I.A. Worker Is Subject to Review, Court Holds,” 16 Jun. 1988 (http://www.nytimes.com/1988/06/16/us/dismissal-of-gay-cia-worker-is-subject-to-review-court-holds.html?pagewanted=all&src=pm)