In G I Jane, officials questioned Jordan after she was seen with a member of the same sex in public with proof (a picture).
Is it wrong for a NAVY SEAL soldier to be seen with a member of the same sex in public?
But this isn't the reason that Jordan was in trouble.
The reason that she was in trouble is because they were trying to portray her as a lesbian, and...
From 1993 the United States Armed Forces had a Don't Ask, Don't Tell (DADT) policy. This meant you could be "closeted" and still serve however you could not be openly gay.
In particular to your question:
The act specified that service members who disclose that they are homosexual or engage in homosexual conduct should be separated (discharged) except when a service member's conduct was "for the purpose of avoiding or terminating military service" or when it "would not be in the best interest of the armed forces"
In December 2010, The House and Senate passed, and President Barack Obama signed the Don't Ask, Don't Tell Repeal Act of 2010 and, under its provisions, restrictions on service by gay, lesbian, and bisexual personnel ended as of September 20, 2011.
So at this point in time, filmed in 1997, it was after 1993 and the signing of the DADT act but before 2011 and the signing of the Don't Ask, Don't Tell Repeal Act, it would have been against DADT for her to have been a lesbian in the SEALs.
As she was becoming a bit of an embarrassment to the establishment by doing so well and becoming a bit of a celebrity, they were trying all they could to get rid of her, including portraying her as a lesbian, by using the photo as "proof", for which they could have discharged her.
In total at least 13,650† service personnel were discharged under the terms of DADT in the 17 years it was in place.
†not all discharged personnel will have come forward with the reasons for their discharge