"The motivation for the secretary's action was obviously political," U.S. District Judge Edward Korman wrote in reference to Health and Human Services Secretary Kathleen Sebelius, who made the 2011 decision.
The FDA had been poised to allow over-the-counter sales with no age limits when Sebelius took the unprecedented step of overruling the agency.
If the Obama administration appeals Korman's ruling, it could reignite the simmering battle over women's reproductive health, which is never far from the surface in American politics. An appeal also could sidetrack the president just as he's trying to keep Congress and the public focused on gun control, immigration and resolving the nation's budget woes.
"There's no political advantage whatsoever," said Democratic strategist Hank Sheinkopf. "It's a side issue he doesn't need to deal with right now. The best idea is to leave it alone."
Still, Obama has made clear in the past that he feels strongly about the limits. As a politician whose name won't ever appear on a ballot again, it's hard to see the downside in sticking by his principles.
"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," Obama said in 2011 when he endorsed Sebelius' decision.
The Justice Department said it is evaluating whether to appeal. Allison Price, a department spokeswoman, said there would be a prompt decision.
The White House said Obama's view on the issue hasn't changed since 2011.
"He supports that decision today. He believes it was the right common-sense approach to this issue," White House spokesman Jay Carney said.
Appealing the decision could rile liberal groups and parts of Obama's political base that are already upset with his forthcoming budget, which includes cuts to programs like Medicare and Social Security.
But currying favor with conservatives who want the ruling to stand probably won't do much to help Obama make progress on his second-term priorities.
"It won't help him with Republicans in Congress to get policy matters attended to," Sheinkopf said.
Also weighing on Obama and his aides as he decides how to proceed is the unpleasant memory of previous dust-ups over contraception.
Among them is an election-year spat over an element of Obama's health care overhaul law that required most employers to cover birth control free of charge to female workers as a preventive service.
That controversy led to lawsuits that threatened to embroil Obama's health care law, already under fire for a requirement that individuals buy insurance, in even more legal action.
When Obama offered to soften the rule last year, religious groups said it wasn't enough. Obama proposed another compromise on the rule in February to mixed response from faith-based groups.
If the court order issued Friday stands, Plan B One-Step and its generic versions could move from behind pharmacy counters out to drugstore shelves. That would end a decade-plus struggle by women's groups for easier access to these pills, which can prevent pregnancy if taken soon enough after unprotected sex.
Women's health specialists hailed the ruling. They said there's no reason that a safe birth control option shouldn't be available over the counter and they dismissed concerns that it could encourage underage people to have sex.
But social conservatives, in a rare show of support for Obama's approach to social policy, said the ruling removes common-sense protections and denies parents and medical professionals the opportunity to be a safeguard for vulnerable young girls.
"The court's action undermines parents' ability to protect their daughters from such exploitation and from the adverse effects of the drug itself," Deirdre McQuade, spokeswoman for the U.S. Conference of Catholic Bishops.
Half the nation's pregnancies every year are unintended. Doctors' groups say more access to morning-after pills, by putting them near the condoms and spermicides so people can learn about them and buy them quickly, could cut those numbers.
The morning-after pill contains a higher dose of the female progestin hormone than is in regular birth control pills. Taking it within 72 hours of rape, condom failure or just forgetting regular contraception can cut the chances of pregnancy by up to 89 percent.
It works best within the first 24 hours. If a woman already is pregnant, the pill has no effect.
Absent an appeal or a government request for more time to prepare one, the ruling will take effect in 30 days, meaning that over-the-counter sales could start then.