If that is written in the law, sadly, the folks challenging it have a point. The state has NO BUSINESS declaring any religious ceremony illegal, if the ceremony does not affect any workings of the state government. If a homosexual couple can find a minister to say some words over them, and they consider themselves 'married', more power to them, but the state does not have to recognize that union as 'legal'.
North Carolina is going to have to think long and hard how to counter this suit, without having to dismantle the entire legislation. If they take out any language that has anything to do with what churches do on their own, they might be able to salvage their stance of no right to legal homosexual 'marriage'.
Ultimately, the only way to solve the problem is to disentangle the whole issue from the state.
How do you feel about a mother marring her son? Or how about a 60 year old man marrying a 9 year old girl? How about multiple group marriages between consenting adults? Where do you draw the line? You do not understand that with homosexual marriage there is NO marriage. At that point, marriage is meaningless.