God help us.
I had to write a paper on it once. In the few examples I could find, the correlation was strong. IMO the apathy or approval of open homosexuality in service were indicators of a dying or crumbling society rather than causes, but the correlation was there.
Spartan Empire after the Peloponnesian War
Theban Sacred Band
Late Alexandrian Empire
Rome at local levels (over its long course this problem cropped up but was tamped down; it sparked local insurrections in several instances)
A scattering of commanders from the 16th - 18th century
French Empire
Spanish Civil War (Republican)
Sturm Abteilung (very overt)
Schutzstaffel (veiled)