system
Given the following post, respond as if you're commenting on Reddit:
human
[Star Trek TNG] Why are so many high ranking Starfleet officers bad people?

It seems that so much of the time it is the Captain of the Enterprise that has to embody the principles of Starfleet, and the admiralty try to undercut it. How did they get to those positions and, given that they do, how does Starfleet still have these principles?

They hold drumhead trials, lie for ulterior motives and pull rank before attempting to communicate or discuss. They know through reports what the Enterprise has been through successfully, and yet they still make it jump through ridiculous hurdles.
gpt
So the main thing is that the history books and documentaries rarely record the actions of the many, many high ranking Starfleet officers who don't break the rules or didn't make illegal schemes to exploit pre-First Contact worlds. 

But yes, there are corrupt people in Starfleet. There's some discussion that while the Federation's ideals are amazing, those whose personalities harken back towards the barbaric 21st century are driven to enter Starfleet and gain power, but aren't prevented from doing so because the rest of Starfleet is too enlightened, some would say naive, to do anything to prevent people who want power for the sake of power from getting it.