How did the CSA have such good military officers but such terrible civilian leadership?
The short answer is that they didn't. Lee was a good theatre commander, the other army commanders didn't even come close. None of them demonstrated the strategic vision to coordinate multiple theatres while the Union produced at least four men who did.