Yup, it was definitely grounds for discharge to be caught in a same-sex relationship, though by 1989 when this story is set, attitudes in many parts (though certainly not all) of the military had mellowed and matched Bill’s. As long as you kept your head down, you’d probably be OK.
Ian’s biggest fear (and mine at the time) would be his losing his security clearance. LGBTQ people then were considered security risks because of potential blackmail, and not eligible to hold clearances. Given most professional officers have to at least some low level clearance, that was a really big deal.