WASHINGTON — All states are now processing benefits for same-sex National Guard spouses after several holdouts found ways to implement the policy without violating their constitutional bans on gay-marriage recognition.

Defense Secretary Chuck Hagel said Friday that same-sex spouses in every state can now obtain the military ID cards they need to receive benefits for wives and husbands of service members.

A handful of states, including Texas, Louisiana, Mississippi and Georgia, refused to process ID applications for gay spouses after the Pentagon issued a directive requiring the military to treat all legally married couples equally for purposes of federal benefits. The states told same-sex couples they could only apply at federal installations, even though opposite-sex spouses could submit their paperwork at state facilities.

Hagel directed the chief of the National Guard Bureau in late October to work with state officials to reach compliance with the Defense Department’s new policy.