The court says New Paltz mayor Jason West acted beyond his authority when he presided over two dozen same-sex marriages last year. The five judges unanimously agreed to uphold the lower-court ruling.
The mayor's lawyer is promising an appeal. West has maintained he was upholding the gay couples' constitutional rights to equal protection, and thus his oath of office, by allowing them to wed.
West was among the first public officials in the nation to marry same-sex couples.
West's gesture came amid a flurry of efforts in various states to enact gay weddings after San Francisco Mayor Gavin Newsom allowed gay couples there to wed in February 2004. Those efforts have largely been put on hold by the courts.
Officials, including Attorney General Eliot Spitzer and Governor George Pataki, have said same-sex ceremonies violate state law.
On the other side of the country, gay rights advocates claimed a major victory after the Alaska State Supreme Court ruled it unconstitutional to deny benefits to same-sex partners of public employees.
In overturning a lower court ruling, the state high court said Friday that barring benefits for state and city employees' same-sex partners violates the Alaska constitution's equal protection clause.