The Volunteer Army was a very political organization. In the beginning every attempt was made to include as many Democrats and influential politicians as possible, in order to make it a "Union" army not an army of the "Republican Party". General's commissions were given out to those who could supply as much political support as possible to the war effort, with a special emphasis on those who could use their political standing to raise large numbers of troops from their constituency. That's how Banks and Butler gaines such high rank, so quickly. The military situation called for professional soldiers (i.e., West Point graduates) to be retained, regardless of prior political affiliation. Hence McClellan was retained in service despite his setbacks, and even his well-known disloyalty towards Lincoln and open disagreement with the administration's political aims for the war.
But as things went badly in the Eastern Theatre during the first years of the war, scapegoats were needed. With the departure of so many Democrats from the southern states from Congress, the Republicans settled in with a comfortable majority, and the support of northern Democrats wasn't deemed quite as necessary. (Support from influential Republicans, like Banks and Butler, was another matter, ensuring their continuance in command long after their incompetence was proven). Democratic generals were blamed for disasters such as 2nd Bull Run (Fitz Porter), and the commander at Ball's Bluff (I forget his name off the top of my head). Since commissions had to be approved by Congress, a good Republican resume' eventually became as important as military success on the field, since many Republican congressmen considered a Democrat to be part of the "McClellan cabal" and therefore untrustworthy.