It isn't the courts job to legislate laws, it is the courts that must abide by them.
If the Law is in question the courts can rule it unconstitutional before it becomes law.
So, if it is unlawful for same sex partners to marry, then it is up to the people to have legislation on the law to have it amended. It appears that the people of Massachusettes do not want the law to change. That's how our Republic works.