The 5-4 decision based on ideological lines ended the high court's term with a legal and political setback for a controversial part of President Barack Obama's healthcare reform law.
It also set off a frenzied partisan debate that will continue through the November congressional elections and beyond over religious and reproductive rights.
All five conservative justices appointed by Republican presidents ruled in favor of closely held for-profit businesses -- those with at least 50% of stock held by five or fewer people, such as family-owned businesses -- in which the owners have clear religious beliefs.
Both corporations -- Conestoga Wood Specialties of Pennsylvania and Hobby Lobby, an Oklahoma-based arts-and-crafts retail giant -- emphasize their conscientious desire to operate in harmony with biblical principles while competing in a secular marketplace.
They argued the Affordable Care Act, also known as Obamacare, violates the First Amendment and other federal laws protecting religious freedom because it requires them to provide coverage for contraceptives like the "morning-after pill," which the companies consider tantamount to abortion.
"The companies in the cases before us are closely held corporations, each owned and controlled by members of a single family, and no one has disputed the sincerity of their religious beliefs," Justice Samuel Alito wrote in the majority opinion.
The four liberal justices appointed by Democratic presidents, including the high court's three women, opposed the ruling as a possible gateway to further religious-based challenges that limit individual choice and rights.
In dissent Justice Ruth Bader Ginsburg wrote the court had "ventured into a minefield," adding it would disadvantage those employees "who do not share their employer's religious beliefs."
The practical result will likely be an administrative fix by the Obama administration that subsidizes the contraceptives at issue, said CNN political analyst Gloria Borger.
"So in terms of a real gap in medical coverage for these women, should they want it, I think what you are going to see is the government sort of picking up where Hobby Lobby would leave off," Borger said.
White House spokesman Josh Earnest signaled as much, telling reporters the Obama administration will work with Congress to ensure women affected by the ruling will continue to have coverage for contraceptives.
Obama believes the decision "jeopardizes the health of women who are employed by these companies," Earnest said.
The decision comes two years after the justices narrowly preserved the health care reforms known as Obamacare and its key funding provision in another politically charged ruling.
This time, the issue revolved around a 1994 federal law known as the Religious Freedom Restoration Act (RFRA), which Alito's opinion said prevents the government from "taking any action that substantially burdens the exercise of religion unless that action constitutes the least restrictive means of serving a compelling government interest."
Alito wrote that the court's conservative majority rejected the argument by the Department of Health and Human Services that "the owners of the companies forfeited all RFRA protection when they decided to organize their businesses as corporations rather than sole proprietorships or general partnerships."
"The plain terms of RFRA make it perfectly clear that Congress did not discriminate in this way against men and women who wish to run their businesses as for-profit corporations in the manner required by their religious beliefs," he wrote.
Monday's case presented a complex mix of legal, regulatory, and constitutional concerns-- over such hot-button issues as faith, abortion, corporate power, executive agency discretion, and congressional intent.
The political stakes were large, especially for the future effectiveness of the health law itself, which marked its fourth anniversary this spring.
The botched rollout of HealthCare.gov, the federal Obamacare website, was another political flashpoint along with other issues that many Republicans say proves the law is unworkable.
They have made Obamacare a key campaign issue in their fight to take control of the Senate while retaining their House majority.
"Today's decision is a victory for religious freedom and another defeat for an administration that has repeatedly crossed constitutional lines in pursuit of" big government, said House Speaker John Boehner, an Ohio Republican. "The President's health care law remains an unworkable mess and a drag on our economy."
Rep. Debbie Wasserman Schultz of Florida, who heads the Democratic National Committee, framed the ruling as a campaign issue for November.
"It is no surprise that Republicans have sided against women on this issue as they have consistently opposed a woman's right to make her own health care decisions," she said, calling the ruling a "dangerous precedent."
Barbara Green, a founder of Hobby Lobby, called the ruling "a victory, not just for our family business, but for all who seek to live out their faith."
However, Senate Majority Leader Harry Reid of Nevada said the decision "jeopardizes women's access to essential health care," adding that "your boss should never be able to make your health care decisions for you."
The section of law in dispute requires some for-profit employers to offer insurance benefits for birth control and other reproductive health services without a co-pay.
A number of companies equate some of the covered drugs, such as the so-called morning-after pill, as causing abortion.
The specific question presented was whether these companies can refuse, on the sincere claim it would violate their owners' long-established moral beliefs.
Supporters of the law fear the high court setback on the contraception mandate now will lead to other healthcare challenges on religion grounds, such as do-not-resuscitate orders and vaccine coverage.
More broadly, many worry giving corporations religious freedom rights could affect laws on employment, safety, and civil rights.
The Hahn family, owners of Conestoga, and the Green family, owners of Hobby Lobby, said some of the mandated contraception prevent human embryos from being implanted in a woman's womb, which the plaintiffs equate with abortion.
That includes Plan B contraception, which some have called the "morning after" pill, and intrauterine devices or IUDs used by an estimated 2 million American women.
Monday's decision comes two years after the justices allowed the law's "individual mandate" to go into effect.
That provision requires most Americans to get health insurance or pay a financial penalty. It is seen as the key funding mechanism to ensure near-universal health coverage.
Under the Affordable Care Act, financial penalties of up to $100 per day, per employee can be levied on firms that refuse to provide comprehensive health coverage. Hobby Lobby, which has about 13,000 workers, estimates the penalty could cost it $475 million a year.
The church-state issue now in the spotlight involves rules negotiated between the Obama administration and various outside groups. Under the changes, churches and houses of worship are completely exempt from the contraception mandate.
Other nonprofit, religiously affiliated groups, such as church-run hospitals, parochial schools and charities must either offer coverage or have a third-party insurer provide separate benefits without the employer's direct involvement. Lawsuits in those cases are pending in several federal appeals courts.
The cases are Burwell (Sebelius) v. Hobby Lobby Stores, Inc. (13-354); and Conestoga Wood Specialties Corp. v. Burwell (Sebelius) (13-356).