NASA did not have such a policy, even when the U.S. military did (1993-2011).
To date, there are 3 known LGBT astronauts:
Sally Ride was the first U.S. woman in space. She was selected as an astronaut in 1978, flew STS-7 in 1983, flew STS-41-G in 1984, served on the Rogers Commission for the Challenger disaster, was scheduled for the cancelled STS-61-M flight, and left NASA in 1987. She was married to male astronaut Steven Hawley 1982-1987, and was with her domestic partner Tam O'Shaunessy 1985-2012 (Ride's death).
As a member of the commission studying the Challenger disaster, Ride was critical of NASA. It appears that this had more to do with her leaving NASA, not her personal life. In any case, she was not active in NASA during DADT, nor did she ever serve in the miltary.
Wendy Lawrence served as a Captain in the U.S. Navy as helicopter pilot. She was selected as an astronaut in 1992; flew STS-67, STS-86 to Mir, STS-91 to Mir, and STS-114 to ISS; and retired from NASA in 2006. The date of her marriage is not readily available.
Lawrence would have had the most exposure of a hypothetical DADT policy in NASA. She moved from the military to NASA just before DADT became policy. Her military service occurred prior to DADT, when being openly-LGBT would be cause for discharge. She perhaps had the advantage that her father was a Project Mercury finalist, Vietnam POW, and U.S. Navy Vice Admiral.
Anne McClain served as Lt. Colonel as a helicopter pilot in the U.S. Army. She was selected as an astronaut in 2013 (after the end of DADT), flew to the ISS on Soyuz MS-11 in 2019 (2 spacewalks, plus the infamous two-woman spacewalk that was cancelled due to spacesuit issues), is still active in NASA, and is selected as an Artemis astronaut. She married in 2014.
DADT was active but ended while she was in the Army. It did not affect her NASA career.
There is also an organization specifically promoting openly-LGBT astronauts called Out Astronaut. They claim that military policies such as DADT also impact astronauts:
Throughout our time as a spacefaring species, the space industry has grown along a military trellis, with a checkered history of LGBTQ discrimination. From the former Don’t-Ask-Don’t-Tell policy to the current ban against transgender servicemembers, USA military regulations have mounted hostile positions against sexual and gender minorities. This kind of injustice trickles down through institutions and ultimately stains the fabric of society. The silver lining is that interindividual support can still flourish among servicemembers themselves, and military providers express a general willingness to learn how to support their LGBTQ peers more effectively. Discriminatory spaceflight restrictions have specifically targeted candidates who engage in same-sex sexual behavior or are transgender.
Such a claim is subject to opinion. The 3 astronauts described above do not seem to have their NASA careers adversely impacted by DADT.