The Supreme Court is there to decide on whether any challenged law is in accordance with the Constitution or not. Hence it is Constitutional vs. Unconstitutional. Not "right versus wrong" or "legal versus illegal" or even "good versus bad". Whenever they use liberally (definitional, vice political sense of the word) interpreted rulings to override the will of the people as expressed in plain language in the Constitution, they are out of their lane in my opinion.
You can't just blame the courts, though. Congress can pass an amendment, and the President can just ignore the decision entirely if Congress is in agreement with the policy.
There are times throughout history where the Supreme Court was ignored, such as when they said that segregation was un-Constitutional. We have a system of checks-and-balances. The SC is not all-powerful, no matter how much it tries to pretend it is. There is a supposed Andrew Jackson quote regarding a SC decision.
So the question isn't that the MA SC legislated from the bench, the question is why did the other two branches of government listen to it instead of take the appropriate action? My guess is that the population of MA really didn't have much of an issue with gay marriage, so they let it go.
As far as separation of church and state:
You're right that the Constitution does not specifically say that. However, the 1st amendment was founded clearly on the basis that people should not be forced into worshipping a particular religion by the government. Since schools are run by the state government, and each state has adopted and agreed to adhere to the Constitution, you cannot have schools forcing children to recite prayers.
Again, I don't care if schools offer prayer as an optional service/activity for students (or mandatory with parental consent). However, to force all children to recite a particular prayer in school, which is what often occurred before the court decisions, is, in my opinion, against the spirit of the 1st amendment.