Because laws routinely treat different categories of people differently, the court has developed a three-tier system of analysis that allows most distinctions if there is a "rational basis" for them -- a highly deferential test that requires only that a law be rationally related to a legitimate government purpose. At the other extreme is discrimination based on "suspect classes," such as race or national origin, which receives "strict scrutiny," meaning it must be "narrowly tailored" to achieve a "compelling" government interest.
In between is "intermediate scrutiny" (aka "heightened scrutiny"), which is used in equal protection cases involving gender and requires that a legal distinction be "substantially related" to an "important governmental objective." The plaintiff in this case, joined by the Justice Department, argued that discrimination based on sexual orientation should be subject to heightened scrutiny.
Although the appropriate level of scrutiny was an issue throughout the history of this case, Kennedy never addressed it. But since he says the motivation for DOMA amounted to nothing more than "a bare congressional desire to harm a politically unpopular group," he seems to think the law fails the rational-basis test.
One problem with this description, as Scalia and Justice Samuel Alito note in their dissents, is that it portrays DOMA's supporters -- and, by implication, supporters of state bans on gay marriage -- as bigots with no rational basis for their position. In a country where at least two-fifths of the population still opposes gay marriage, that may not be a winning message.