> The judge could only sentence for the lesser crime he agreed to.
And you conveniently forget that, that lesser crime is liable for a sentence of up to 10 years. To give 6 months on a crime with an up-to-10-years sentence requires very, very strong mitigating circumstances. A judge who does that is effectively saying "this person has pled guilty, or technically broken a law, with no malicious intent and his actions really shouldn't be a crime but since I'm forced to punish him I'll give him a rap on the knuckles".
Now there are certainly times when that is exactly the appropriate thing for a judge or jury to do. There are definitely times when lenience from a court is exactly what a free society demands. Giving the teacher in the Scope's trial a 1 dollar fine was the best outcome possible under a bad law. The reason we give courts in free countries such discretion is exactly because we believe they need to be able to show mercy or leniency at times. The single most immoral thing about tough-on-crime laws and the drug was has been the proliferation of mandatory-minimum-sentences which remove that discretion.
Brock Turner was NOT however an example of the kind of case for whom that discretion exists. Turner was exactly an example of the kind of person who should have faced the full might of the law. Here was a rapist asshole - who still shows absolutely no remorse, whose father described his rape as "20 minutes of action" and blames the whole thing on "drinking and promiscuity" (there is no crime in promiscuity - but sexual acts with a drunk person who cannot consent is not promiscuity - it is rape). A crime which evoked such horror in passersby that they intervened, tackled him and held him down until police arrived to try and rescue his victim (people tend not to readily get involved in crimes that don't affect them personally - doing so shows how upsetting that scene must have been).
This was a case with extreme aggravating circumstances. The judge would be fully justified to reject the plea bargain and insist Brock faces up the original charge sheet and stands trial (whatever he pleads) but having accepted the bargain - the judge OUGHT to have given him the maximum allowed sentence. Preferably in a maximum security prison where he had high odds of experiencing lots of bigger men than himself treating him with the same complete lack of respect for his bodily autonomy that he had shown that poor girl.