legal gay marriage vs. don't ask don't tell

It says “a marriage or attempted marriage to someone of the same gender.”

So the army doesn’t care if the Federal government recognizes or doesn’t recognize your gay marriage, you can be discharged either way.

If statutes can be read without conflicting with each other, then that reading of the law controls. If they cannot be read without conflict, then either the more specific, or the last enacted, wins.

It’s easy to read DADT and DOMA as laws that don’t conflict with each other, so there is no issue.

IOW, your reading of the word “recognize” is an equivocation that wouldn’t appear in the context of either law.