I am going to preface this by saying that I hardly know anything about the Stanford case and only heard about it more in depth here. So, I can't speak to that case specifically.
As someone who works in the judicial system, there are often things that the public doesn't understand and/or the media doesn't understand and reports incorrectly. In most cases involving sentencing, there are guidelines that judges have to follow. Some benefit the defendant while others benefit the State. Those guidelines are usually outlined by statute, and the judge must consider them to reach a sentence. The judge can't just pick a sentence out of thin air. Each state is different, and federal courts have statutory and "advisory" guidelines as well. The judge can't go above or below the statutory parameters but there is some deference within that range.
All of this to say that absolutely every single case in the judicial system stands alone. Each case is different, has a different fact scenario, and each defendant and victim have their own stories and backgrounds. All of those things are taken into consideration at sentencing. Just that simple (or complicated).
I have no idea if the judge in California abused his discretion. I am not familiar with the exact facts or with California law. However, society just hears a certain sentence for a case and sometimes fails to understand the reasoning why judges made their decision. As I saw an earlier discussion about the Vandy case, in TN, aggravated rape carries 15 to 25 years. That cannot be changed by a judge as it is set by the legislature. The judge then has guidelines on where to start and where to end.
Sorry for the long post, but it gets frustrating sometimes when the public makes assumptions about cases when the judge very well may have been doing what he is supposed to do.