I've heard a lot of people say that this country is one where the majority rules. I don't think it's as simple as that. I believe that our Founding Parents wisely established a three-legged stool of government to balance the convictions of the majority with the needs of the minority.
In high school civics class, I was taught that the purpose of the legislative branch of government is to make laws, the executive branch to enforce them, and the judicial branch to interpret them. I think this is really their roles, not their purposes – what they do, not the intent behind what they do.
The real purpose of the legislative branch is to establish the will of the majority of our citizens.
And the purpose of the judicial branch is to protect the minority from tyranny by the majority. In other words, to make sure that any law passed by the majority impacts all people equally; and that the majority cannot make laws that violate the rights of the minority.
This system doesn't work perfectly – the judiciary is too easily swayed by majority opinion or personal conviction – but often it works pretty darn well. A good case is California, where the California Supreme Court made the correct call in requiring that the laws of marriage apply equally to all people. That is the purpose of the court, doing what it is meant to do, doing what it does best.