A federal judge in California temporarily blocked the Trump administration’s plan to exempt companies with religious or moral objections from an Obamacare requirement that employers include free contraception in their health-care plans, though the ruling only applies in 13 states.

U.S. District Judge Haywood Gilliam in Oakland, California, on Sunday issued a preliminary injunction against the Affordable Care Act exemption, ramping up the culture war triggered by President Donald Trump’s attempt to extend “religious freedom” rights from churches to companies. The rules are set to take effect Monday.

The decision is a victory for a coalition of blue states led...