BOSTON — A U.S. judge in Boston has ruled that a federal gay marriage ban is unconstitutional because it interferes with the right of a state to define marriage.

U.S. District Judge Joseph Tauro today ruled in favor of gay couples’ rights in two separate challenges to the 1996 Defense of Marriage Act.

The state had argued the law denied benefits such as Medicaid to gay married couples in Massachusetts, where same-sex unions have been legal since 2004.

Tauro agreed, and said the act forces Massachusetts to discriminate against its own citizens.

The Justice Department argued the federal government has the right to set eligibility requirements for federal benefits – including requiring that those benefits only go to couples in marriages between a man and a woman.