The Equal Protection clause of the 14th Amendment prohibits any state from denying equal protection under the law. The specific wording of the 14th Amendment is as follows:
nor [shall any state] deny to any person within its jurisdiction the equal protection of the laws.
With regards to same-sex marriage specifically, this means that the state cannot treat heterosexual and homosexual marriages differently, as this would constitute unequal treatment under the law. From the decision (emphasis added):
It is
now clear that the challenged laws burden the liberty of
same-sex couples, and it must be further acknowledged
that they abridge central precepts of equality. Here the
marriage laws enforced by the respondents are in essence
unequal: same-sex couples are denied all the benefits
afforded to opposite-sex couples and are barred from exercising a fundamental right
The Court largely justified its decision under the Due Process clause of the 14th Amendment. However, since Bolling v. Sharpe, due process legally implies equal protection. In fact, the 5th Amendment's Due Process clause is what the Court used to rule Section 3 of the Defense of Marriage Act unconstitutional in US v. Windsor.
US v. Windsor provides us with more information as to specifically how bans on homosexual marriage result in unequal protection for homosexuals under the law. From the decision:
It prevents same-sex married couples from obtaining government healthcare benefits they would otherwise receive.
...
It deprives them of the Bankruptcy Code's special protections for domestic-support obligations.
...
It forces them to follow a complicated procedure to file their state and federal taxes jointly.
...
It prohibits them from being buried together in veterans' cemeteries.
The fact that bans on same-sex marriage result in the law treating homosexual couples and heterosexual couples differently means that such bans imply unequal protection under the law, and thus violate the Constitution's prohibition on unequal protection under the law.