1. As the US grew and the workload required to govern it grew, Congress' ability to directly and quickly manage the country was outpaced. Consequently, agencies served as the grease between Congress' high-level actions/funding and the low-level implementation.
2. Due to the ever-adversarial nature of Congress, it was recognized that most Congresses operated slowly, and consequently didn't have the capacity to micromanage at the level required for direct control.
3. Circa 1900, civil service reform by the then-progressive wing of the Republican party pushed for greater isolation of the expertise that drove good government outcomes (in civil service employees) from politicians (administrators).
The flaw Trump revealed was that the President has too much direct power over the civil service, if he chooses to ignore tradition.
This wasn't always the case, and laws that previously restrained the President's ability to fuck with the civil service were substantially relaxed in the 60s - 80s (?).