The decision to take Bonds to trial was just a horrendous call by the prosecutor. You settle this thing out when you have a case this flimsy. Count after count was thrown out or dropped ahead of time. In theory, this should pare down your case to your strongest count, but whoever the heck the superviser was for the prosecutor should have had a sense that this guy was overconfident.
The way things work is that the government will steamroll little guys, but if they go after someone who has competent defense and money, the odds quickly get closer to even or favoring the defendant. The government then has to make a decision on the importance of the case and whether to go all in. Even then, the government will lose more than the testosterone overdosing prosecutors think is possible. When it is big stakes, everyone is better off cutting a deal.