In Nebraska, where I reside, the law refers to "preachers of the gospel", which would seem to rule out ministers from any religion other than a Christian denomination, but in practice, Nebraska makes no attempt to decide who is a "real" minister & who isn't, and rabbis, imams and ministers ordained online are all recognized, or at least ignored. In fact, Nebraska Statute 42-114 states that if someone says that they're authorized to perform marriages and the couple believes that the officiant is authorized to perform marriages, then the marriage is valid. Part of me wishes they would excise "preachers of the gospel", but the other part of me just wants to leave well enough alone!
There are several states that have a narrow definition of who is authorized to officiate a wedding ceremony that specifically rules out ministers ordained online. These rulings have in general been spurred by court cases where someone is attempting to invalidate a prenuptial agreement or avoid alimony by claiming that being married by an online minister means that theirs was not a valid marriage. In most cases the legislation isn't unambiguous, and in some states there are contradictory court rulings. The big question is: why is this a subject in which the state has an interest?
In some religions, marriage is a sacrament that is to be consecrated by that religion's holy man or woman. In others, it's a matter of the minister, as representative of their religion, giving his or her blessing or approval for the marriage. In those cases, it makes sense to have an officiant who is in sync with the couple's faith, but that should be the business of the couple; the state should have no role in deciding whether a particular minister is in fact in sync with the couple. Of course, in most places there are secular options. As I mentioned above judges, active or retired, can usually officiate, as well as other designated government representatives. But for many people, weddings done by a judge or city clerk lack the warmth and uniqueness that they are looking for. In many places, including my own state, the alternative is either a professional officiant who isn't affiliated with any church, or a friend or relative who has received an online ordination.
For those who aren't looking for a spiritual blessing on their union, but just want to have a nice ceremony, why should the credentials of the officiant be an issue that the state takes note of? In most cases the couple isn't looking for counselling, in fact they're probably looking to avoid counselling! What can a minister who was ordained in an established denomination offer a couple that a professional, experienced officiant can't? There's the possibility that a seminary graduate has had some training in how to conduct a wedding, but possibly not. And considering that the government should constitutionally have no role in religion, why are some state governments and state courts making judgments as to which ordinations are valid and which are not?
I would propose that all references to religious affiliation be removed from marriage statutes and that a marriage be registered and considered valid if the paperwork was filled out correctly. Professional wedding officiants could still operate as they do now, but without the necessity of getting the online ordination. It might even reduce the number of inexperienced friends and relatives performing wedding services - now, anyone who gets an online ordination thinks that they are now qualified to officiate a wedding, when in fact they are only legally authorized to officiate a wedding, the ordination doesn't give one a magical ability to write coherent and smooth-flowing services, or become an effective public speaker.
It's probably not going to happen any time soon, but government should get out of the wedding business, other than issuing the licenses.