The story
From closet + -gate; from the name of the South Park television episode "Trapped in the Closet" (referring to the figurative "closet" that homosexuals who have not disclosed their sexual orientation are said to be in).
Etymology from Wiktionary, CC BY-SA 4.0.