Casull, I dealt with both sides of the coin. It's about winning, money, and records. Plea bargains look like wins on paper, and make excellent running for higher office stats.
Winning on the defense side means reputation and higher fees, and maybe an office run later.
Sourdough is right about prosecutors also. They sometimes let their ambitions blind them.
But think about using every trick in the trade to get a child molester off. Just an example Sourdough used. If it's a young girl say, twelve to fifteen years of age, that has been molested. The defense attorney will attempt to destroy her reputation, and make her look like a whore. He will do everything in his arsenal to convince the jury that it was the young girl whom was at fault. Have seen it myself, and then the same attorney will make big donations to his church, and charities, and everyone will talk about how generous he is, and what a civic leader.
It comes from both sides of the bar, with both the prosecutor,and the defense attorney indignantly swearing and defending that is all in the name of justice, fairness, a fair trial
, and the judicial system.