There is a work around. The Church should do Holy Matrimony only. They should get out of the civil marriage business.
And, most importantly, marriage in a church is not a public utility. It is for members. Open, defiant homosexuals can be excommunicated, and hence barred from membership and the privileges of membership.
Irony of ironies, it may take this decision and ensuing litigation to force the Church to enact effective discipline against unrepentant homosexuals.