Given the rapid advance of gay rights over the last decade, it’s tough to remember just how different the stage was in 2006, when Gates replaced Donald Rumsfeld as defense secretary. “Don’t ask, don’t tell” had had plenty of critics since it was enacted in 1994—President Bill Clinton himself would have preferred simply opening the military to gay servicemembers—but it was still firmly in place. The Bush administration was not interested in lifting the ban, and Gates took a cautious approach. He repeatedly told reporters that he was not reviewing or reconsidering the policy.

When, several months into his tenure, the chairman of the Joint Chiefs of Staff, General Peter Pace, said that “homosexual acts between individuals are immoral,” Gates tried to avoid discussing the comments, and said of DADT, “As long as the law is what it is, that's what we'll do.” (Pace, who retired in September 2007, reiterated his personal opposition to homosexuality during an exit hearing with Congress, but also endorsed gay service in the military.) When, two months later, the military ejected 58 desperately needed Arabic linguists because they were gay, Gates still said the policy wasn’t under review.

Even after President Obama was elected and Gates accepted an offer to stay on as secretary, he remained cautious. Though the president pledged to repeal DADT during his first State of the Union, Gates expressed a preference in March 2009 to “push that one down the road a little bit,” infuriating gay activists. Yet in June, he was clearly expecting the policy to end and was exploring whether “there’s a more humane way to apply the law until it gets changed.” A similar pattern held in 2010, as Gates warned Congress not to repeal DADT before he had a policy in place for the aftermath and insisted courts not make the decision. He also issued a survey on gays to servicemembers, a step that LGBT activists, who saw it as putting civil rights to a vote, disagreed with. Yet there Gates was in the fall, saying DADT’s demise was “inevitable” and testifying to Congress in favor of repeal—before the courts did it. (And that survey? It turned out the troops were totally fine with LGBT comrades.)

Once DADT was repealed, Gates moved quickly to enforce discipline and get the change implemented in the military, and shot down any hopes that soldiers, sailors, and marines who disagreed with the policy could leave their commitments early.

Gates’s push for the end of DADT never relied on the soaring rhetoric of rights and justice that people like Obama used. Gates spoke with the dry, careful language of a bureaucrat, speaking in terms of unit cohesion, military readiness, and obstacle recognition. When he indulged emotion, it was to praise soldiers risking their lives—the same language a defense secretary would use for straight soldiers. The decision was more than anything a triumph of pragmatism. Gates carefully studied the effects repeal would have on the military and decided the downsides were minimal; and he looked at the way the country was changing and realized that the policy would have to end soon, and that he wanted it to end on the Pentagon’s terms to ensure the military’s stability and long-term health.