Like I said, I was glad that the RCC provided these services where they did not exist. It might even be arguable that Catholic Charities, or some such organizations that exist simply to give things to people should be protected by the same rules that govern essential church functions. These functions are already protected by exemptions in the law that prevent a woman from suing the RCC under equal rights laws to ordain her as a priest.
But Catholic universities, hospitals, and perhaps other entities are competing in the free market, and sell their services alongside other providers, both private and governmental. Sometimes a government mandate is financially onerous on private entities, if you give an exemption for it to government and nonprofit entities, you've created an unfairness.
In a way, this is the Catholic Church's "social justice" power coming around to bite it on the butt. Sort of a payback for all the years the RCC has been championing the minimum wage, for instance.
All these functions are core duties of the church. If you do not educate then you are failing to carry out God's command to go into all the world. If you do not operate hospitals (or other healing centers) then you are ignoring God's command to heal the sick. These are core functions of Christian belief and any imposition of perverse sexual behavior on them violates the first ammendment
(Note: The RCC and some larger protestant denominations have the means to operate hospitals etc. and they should. Some smaller denominations and independent churches can't operate a hospital but they are still called to heal the sick so they must be active some way in this calling.)