A federal judge on Friday ordered that the most common morning-after pill be made available over the counter for all ages, instead of requiring a prescription for girls 16 and younger. But his acidly worded decision raises a broader question about whether a Cabinet secretary can decide on a drug’s availability for reasons other than its safety and effectiveness.

In his ruling, Judge Edward R. Korman of the Eastern District of New York accused the Obama administration of putting politics ahead of science. He concluded that the administration had not made its decisions based on scientific guidelines, and that its refusal to lift restrictions on access to the pill was “arbitrary, capricious and unreasonable.”

He said that when the health and human services secretary, Kathleen Sebelius, countermanded a move by the Food and Drug Administration in 2011 to make the pill, which helps prevent pregnancy after sexual intercourse, universally available, “the secretary’s action was politically motivated, scientifically unjustified, and contrary to agency precedent.”

Sebelius said at the time that she was basing her decision on science because she said the manufacturer had failed to study whether the drug was safe for girls as young as 11, about 10 percent of whom are physically able to bear children. But her decision was widely interpreted as political because emergency contraception had become an issue in the abortion debate and allowing freer access for adolescents would prompt critics to accuse the president of supporting sexual activity for girls of that age.

At the time, President Barack Obama was campaigning for re-election, and some Democrats said he was conscious of avoiding divisive issues that might alienate voters. He said then that he was not involved in the decision but supported it, “As the father of two daughters: I think it is important for us to make sure that we apply some common sense to various rules when it comes to over-the-counter medicine,” he said.

And he reiterated that position Friday through the White House press secretary, Jay Carney, who said, “He believed it was a common-sense approach when it comes to Plan B and its availability.”

Carney declined to comment on whether the administration would appeal the decision. A Justice Department spokeswoman, Allison Price, said the department was reviewing the 59-page order and the appellate options and “expects to act promptly.” Korman gave the FDA 30 days to lift age and sale restrictions on the pill, Plan B One-Step, and its generic versions.

Many groups that are part of Obama’s political base praised the decision to make the emergency contraceptive pill more easily available, a position that in some ways is more consistent with the administration’s position on other women’s reproductive health issues, including the free provision of contraceptives through Obama’s health care overhaul.

Conservative and anti-abortion groups assailed the judge’s decision, suggesting that it may allow the pill to be given to young girls without their consent. They also say that girls who can skip the requirement to visit a doctor for a prescription may have sexually transmitted infections that go undiagnosed and untreated.