Is extremely simple. All the states need do is cease issuing marriage licenses altogether. End of controversy.
As long as states required testing for STDs, there was a legitimate reason for a state to issue a marriage license. Public health is a legitimate concern of state government.
Since the advent of AIDS, many states have dropped the testing requirement - and so, have lost the only justifiable reason for licenses. Of course, there is always the issue of fees and taxes, but I would believe that the costs outweigh the income and the controversy.
No state licenses would make the Supreme Court ruling meaningless. If two people want to get married, they can find a suitable preacher or "justice of the peace", or just declare themselves married. That's how it worked for hundreds of years. Common law marriage is still observed in several states. Custody of children, inheritance, and such issues have lots of legal precedent, as do contracts and "pre-nup" agreements.
Of course, we should expect that there will be cases where preachers will not want to participate in an action they find sinful or wrong. Lawsuits will undoubtedly follow.