The reason for this is stability. Congress, businesses, international allies, and most US citizens typically don't want things to dramatically change every new presidential administration. And the primary way to ensure that stability is to make it so the same people are working in various government offices from administration to administration. And I think people are quickly learning why that stability is desirable, as the current administration attempts to dismantle it with no consideration for the consequences.
So the upper management is composed of political appointments. And like any other organization, the upper management has considerable discretion in setting priorities.
re: "politically selective law enforcement" is not a good thing, because laws are one of the things that are supposed to constrain politicians.