1. The Federation is most interesting when it has an ideological foil
The original Star Trek pitted Captain Kirk against fake gods, rogue Starfleet officers, and sadistic computers, but the show was often concerned with a Cold War-style rivalry between the Federation and two warlike powers, the Klingons and the Romulans. The Federation seldom needed to demonstrate its own peace-loving, liberal values—it just needed to appear in contrast with civilizations that were bent on domination and conquest. Similarly, Star Trek: The Next Generation was never so vital as when its ethos of individualism and self-improvement was in contrast with the collectivist, anti-individualist Borg. (An earlier attempt to give the TNG-era Federation an ideological foil, the hyper-capitalist Ferengi, basically fizzled.)
In Star Trek: Deep Space Nine, the Federation’s light touch when it came to matters of religion and self-determination (vis-a-vis the Bajorans) stood in contrast to the coercive theocracy of the Dominion. People often try to find a “bad guy” in Trek, like Khan for example—but these shows and movies usually work best when there’s an ideological struggle against another civilization or organization. Count me among those who really enjoyed the struggle against the Emerald Chain in Star Trek: Discovery, and was sad to see them dispatched so easily.