An international student asked a very good question in our class the other day.
He noted that because of federalism, states generally have the power to regulate marriage. When people get married in the United States, a state, not the national government, certifies the marriage.
But the student also noted that he learned that states may not prohibit a same-sex couple from getting married. That is, if two men or two women want to get married, the state must permit the marriage. How can this be if states regulate marriage within their borders? Under what authority can states be required to allow same-sex couples to get married?
The Constitution and the Supremacy Clause
The answer is connected to the Constitution of the United States and the Supremacy Clause (more info on the Supremacy Clause here).
No law is higher in the United States than the Constitution – – that is why the Constitution is called the Supreme Law of the United States. If any law violates the Constitution, a court can declare the law unconstitutional through its power of judicial review.
You can think of this like a card game. The Constitution is the highest card in the deck, the Ace of Spades. Any other card is weaker than the Ace of Spades. We’ll say a state law is the Queen is Hearts. Because the Ace of Spades is higher than the Queen, the Ace of Spades wins.

The Ace of Spades wins
The Supreme Court Determines that Laws against Homosexual Marriage Violate the Constitution
In its 2015 decision, Obergefell v. Hodges, the Supreme Court held that homosexuals have a Constitutional right to marry. More specifically, the Court held, among other things, that the 14th Amendment’s Due Process Clause and Equal Protection Clause prohibit states from discriminating against homosexual couples by denying them the right to marry.
Remember, no law is above the Constitution. Therefore, because the Constitution guarantees homosexuals the right to marry, any state law that would deprive homsoexuals of the right to marry is unconstitutional.
Although states have the power to regulate marriage, states do not have the power to violate the Constitution. Because the Supreme Court found that homosexuals have a Constitutional right to marry, states cannot deprive same-sex couples of this right.

No law is above the Constitution