The Supreme Court ruled that the government, in its background investigations of employees, can ask about their drug treatment, medical conditions or other personal information.

In NASA v. Nelson, the court unanimously upheld NASA's background checks of scientists in California and ruled the questions do not violate the employees' constitutional privacy rights.

The Obama administration had defended the routine background security investigations and described them as standard for millions of federal employees since 1953 and for contractors since 2005.

It said that NASA facilities have sensitive information, that the questions can be justified partly on national security grounds and that adequate privacy safeguards existed to prevent any improper disclosures.

The ruling was a defeat for 28 scientists, engineers and other employees who challenged the in-depth background checks required at the Jet Propulsion Laboratory in California as needlessly intrusive. The longtime contract employees, who had been classified as low risk, refused to submit to the checks for information on medical treatment or counseling for drug use or any other adverse information, including private sexual matters.

Government background checks typically include inquiries to an employee's neighbors and friends in seeking personal information, such as emotional and financial stability.

The laboratory, owned by the space agency and operated by the California Institute of Technology, is known for developing satellites, rockets, spacecraft and telescopes.

In the Supreme Court's opinion, Justice Samuel Alito said the challenged questions are reasonable, employment-related inquiries that further the government's interests in managing its internal operations.

Alito said the questions about drug treatment or counseling are a reasonable follow-up to inquiries about illegal drug use, and that the challenged questions are part of a standard background check used by millions of private employers.

He said the government has an interest in conducting background checks to ensure the security of its facilities and to employ a competent, reliable workforce, and there are sufficient protections against disclosure of the information to the public.