Nobody knows where and when the expression actually started but everyone knows that being a “Friend of Dorothy’s” is gay slang for a gay man. In the past, stating that, or asking if someone was a friend of Dorothy was a furtive shibboleth used for discussing sexual orientation while avoiding hostility.
Well in the late 1970s, the Naval Investigative Service was investigating homosexuality in the Chicago area. Agents discovered gay men sometimes referred to themselves as “friends of Dorothy”. Unaware of the historical meaning of the term. The Intelligence Service deduced that “Dorothy” must be an actual woman that functioned as a sort of information hub that gay men could use to find other gay men. If they could only find her, they figured they could convince her to talk, perhaps outing many of the gay navy personnel in the process, who in turn, with a little pressure, could no doubt out many others. The key was simply to find Dorothy.
Of course they failed at finding Dorothy, wasting an amazing amount of taxpayer money paying investigators to pose as gay men.
So now you know.