Wasn't the thinking at the time you could be a security risk if discovered by the other side and blackmailed? The fact that if the RAF knew it would negate that problem was lost on them.
Not that way inclined myself but I thought it was totally wrong to discriminate that way....
BUT it did have the odd advantage I know of one guy who was straighter than a beam of laser light who announced he was gay so he could take advantage of leaving the RAF without paying to buy himself out.