Interesting to see Conway's law show up here. Companies tend to ship their org structure in a product.
You have to understand that the Klingons in TOS were a metaphor for the Soviets/Russians and TNG was reflecting the 1980s/1990s hope that democracy was taking root there and by working with them they would be Westernized.
I've read the Ottoman Empire had this happen with the Janissaries, but there are lots of other instances of the military becoming a colossal useless but dangerous parasite, even lots of current-day ones.