It was not necessarily supposed to be this way.

After California joined the agonizingly long list of states that barred same-sex marriage following a referendum vote last year, supporters of LGBT rights were frustrated and angry.

And it seemed as if America might not be ready for the future — and for the demand that this country’s promise of equality under the law be made real for all our citizens.

Then came the Iowa Supreme Court ruling striking down barriers to marriage equality in that state.

Shortly afterward, the Vermont state legislature legalized same sex marriage there — overriding the veto of a Republican governor.

Then the District of Columbia voted to recognize same-sex marriages performed in Massachusetts, Connecticut and the growing list of states that allow them.

Around the same time, the New Hampshire legislator voted to allow gay and lesbian couples to marry in that state and officials in New York and New Jersey signaled that their states would in all likelihood be following suit.

Now comes Maine.

Maine’s lower house approved a same-sex marriage bill by 89 votes to 57, and the state senate voted 21-13 in favor of it.

The measure went to the desk of Governor John Baldacci, a Democrat who had previously been opposed same-sex marriage marriage.

Baldacci signed the bill Wednesday, saying that “the notes and letters sent to my office” swayed him.

Once again, a concerted campaign by marriage equality activists, in this case the sensitive and smart advocacy organized by EqualityMaine, paid off.

EqualityMaine, a 25-year-old LGBT rights group, ran a terrific campaign on behalf of this legislation, facing down harsh attacks in a state with a well-organized religious-right presence.

EqualityMaine put an emphasis on making heard the voices of native Mainers who said: “I want to get married.”

That’s what influenced Baldacci, who broke new ground by not just signing the legislation but explaining in a remarkably thoughtful statement why he knew it was “the right thing to do.”

Here’s what the governor said:

I have followed closely the debate on this issue. I have listened to both sides, as they have presented their arguments during the public hearing and on the floor of the Maine Senate and the House of Representatives. I have read many of the notes and letters sent to my office, and I have weighed my decision carefully. I did not come to this decision lightly or in haste.

I appreciate the tone brought to this debate by both sides of the issue. This is an emotional issue that touches deeply many of our most important ideals and traditions. There are good, earnest and honest people on both sides of the question.

In the past, I opposed gay marriage while supporting the idea of civil unions. I have come to believe that this is a question of fairness and of equal protection under the law, and that a civil union is not equal to civil marriage.

Article I in the Maine Constitution states that ‘no person shall be deprived of life, liberty or property without due process of law, nor be denied the equal protection of the laws, nor be denied the enjoyment of that person’s civil rights or be discriminated against.’

This new law does not force any religion to recognize a marriage that falls outside of its beliefs. It does not require the church to perform any ceremony with which it disagrees. Instead, it reaffirms the separation of Church and State.

It guarantees that Maine citizens will be treated equally under Maine’s civil marriage laws, and that is the responsibility of government.

Even as I sign this important legislation into law, I recognize that this may not be the final word. Just as the Maine Constitution demands that all people are treated equally under the law, it also guarantees that the ultimate political power in the State belongs to the people.

While the good and just people of Maine may determine this issue, my responsibility is to uphold the Constitution and do, as best as possible, what is right. I believe that signing this legislation is the right thing to do.