There are only two reasonable explanations that I can come up with.
1. The guy knew someone
2. There is tremendous pressure within the Massachusetts legal system to keep people out of prison for no other reason then to avoid the expense of incarceration. Such overwhelming pressure, that even guys like this walk.
What am I missing?
I'm guessing the lawyer had an angle to get the traffic stop and subsequent search thrown out. Maybe the dashcam video didn't support the "crossed the center line" story - the traffic stop becomes questionable, therefore the search is shaky. The DA decides to give up most of the charges to score the win in court and can keep alive their 99.9% conviction rate claim. The bad guy gets a couple more convictions on his rap sheet but doesn't go to jail, so it's a win for him.