Advocates of same-sex marriage won a major legal victory — and greatly increased the odds of a U.S. Supreme Court showdown on the subject — as an appeals court ruled that the government could not deny tax, Social Security and other federal benefits to gay couples who were legally married in their home states.