It may be important to add that at least in the realm of national security, the Lavender Scare extended right through the 1990s.
I experienced it directly in the mid 80s when I was polygraphed by the FBI in a routine security examination. One of the biggest questions on the polygraph was whether or not I was gay.
Gay people then were not allowed to hold security clearances on the dubious theory that they could be blackmailed by enemy operatives.
I gave up a career in national security for that reason.