The point is the purpose of state involvement is to impose an obligation not to grant a right. The gays have been allowed to change the argument to one of rights rather than one of obligations.
The first federal laws in regard to marriage were about federal benefits.
That was legislation by the Continental congress, and then the United States Congress, in 1780, 1794, and 1798 and so on.