(CNN) -- Gov. David Paterson pledged to keep fighting for same-sex marriage in New York after the state Senate on Wednesday killed a bill that would have legalized the practice.

The bill had Paterson's support and had passed the state Assembly. Supporters predicted a close vote going into Wednesday's Senate debate. But eight of Paterson's fellow Democrats, including two members of the Senate leadership, joined a unanimous Republican caucus on the 38-24 vote.

In a statement issued Wednesday afternoon, Paterson said, "It is always darkest before the dawn.

"As disappointed as we are today, let's get up tomorrow and redouble our efforts," he said. "We are going to lay the foundation to make people feel comfortable to vote their conscience and not fear political backlash."

Supporters promised to bring back the bill for "as many do-overs as is necessary to get us home," as Majority Leader Pedro Espada put it before the vote.

"There's never a good time for civil rights. There's never, ever, ever, ever a good time for civil rights. I know. I get that," said Sen. Tom Duane, a Manhattan Democrat who was the chamber's first openly gay member. "But the paradox is, it's always the time to be on the right side of history."

Only one senator spoke against the bill during Wednesday's debate. Sen. Ruben Diaz argued that the issue should be put to a statewide referendum and pointed out that 31 states have banned same-sex marriages in statewide votes.

Diaz, a Democrat and a Pentecostal minister from the Bronx, said many New York religious leaders opposed the bill and called on Republicans to join him in defending "traditional values."

"If we take it to the people, the people oppose it," he said.

But a Marist College poll released Wednesday found that 51 percent of New Yorkers questioned favored legalizing same-sex marriage, with 42 percent opposed. A June poll by Qunnipiac University poll reported a similar spread of 51 percent to 41 percent.