I don't know all the facts here, so somebody may have to correct my impressions, but my understanding is that as part of Bismarck's
Kulturkampf (Germany 1871-1878) Catholic marriage was not legally recognized by the State, while the Church did not recognize civil marriages: so that all Catholics wishing to marry had to have a marriage ceremony from the State, and then afterwards, another one in the church (the latter not officially recognized.) Many Catholics refused to do the civil registration and just went straight to the priest; German Catholic priests by the thousands were imprisoned because they married couples who refused to register for civil marriage.
It might come to that in this country, if the State says that clergy can only legally register marriages if they do it without discrimination (e.g. they must be willing to register divorced/remarrieds, homosexual pairings, etc.) and if they refuse to do so, they lose their legal authorization to register any marriage at all.
It's happened elsewhere.