In the US church officials can only legally marry when formally delegated by the State for that purpose, and a State marriage license must be issued first. The church official merely certifies the marriage has taken place, which is legally a State civil union. No religious official has any extra-legal power to legitimately marry anyone based on church authority alone.
If the couple and the church choose to include a religious marriage ceremony as part of the procedure that is their option, but it is not a legal requirement. A priest or minister can legally marry a couple in the sitting room of the rectory, as if it were before a Justice of the Peace, no church service required at all, as far as the State is concerned.
This is a point conveniently overlooked by the religious Right in the US, that falsely maintains that marriage is their sole domain, for them to exclusively define & administer. The truth is that legal marriage in the US is a State function, and the State defines it, not any church.
If a church chooses not to marry a couple for any reason that is their business. And US laws do not compel them to do so. Civil officials, however, do not have that latitude, and must issue a marriage license to any couple eligible under State law, and must perform the marriage ceremony. While some officials may claim conducting a same-sex marriage violates their personal religious beliefs, most courts will maintain that their acceptance of a public civil position supersedes such a claim to a personal agenda contrary to the civil laws they were hired (and sometimes sworn) to execute.
The question in the Netherlands, a situation which seems similar to the US system, may be whether a church official, in accepting state authority to conduct a wedding, must also accept the state's definition of a marriage. The US makes an exception for clergy, who can restrict the ceremony based on their own religious grounds. It would appear the Netherlands no longer do.