“DOMA instructs all federal officials, and indeed all persons with whom same-sex couples interact, including their own children, that their marriage is less worthy than the marriages of others,” the ruling stated.

It added that the law was invalid because there was no legitimate purpose for disparaging those whom states “sought to protect in personhood and dignity.”

In a separate case, the court ruled that it could not take up a challenge to Proposition 8, the California law that banned gay marriage in that state.

That decision means that gay marriage will once again be legal in California.