Churches are separate institutions that do not get government money. Marriage in a church is only a religious sacrament so they can't be forced to perform that rite.
Religious institutions that get government money are, I believe, what you're referring to regarding birth control. However, I believe you are in error that the government is blocking funds for Catholic institutions. The compromise was that insurance companies themselves would provide birth control rather than the institutions.