One of the most common reasons why one codefendant would get less time than the other is that the one has less criminal history. In State's such as Washington where your sentencing range is based upon your (mostly felony) convictions two people charged with the same crime will get different sentences if they have a different number of "points" that make up their offender score.
Points for certain crimes triple against other like type charges and some double. Most count as 1 point. Juvenile convictions generally speaking count less than felony convictions but there are some variations there as well. Additionally, you may have more open cases being resolved than does your codefendant so when determining your offender score you would have more things to consider in what is referred to as "other current offenses" which will impact the standard sentencing range.
Another reason your codefendant might get a lesser sentence is if he or she "cooperated" with law enforcement. Often such cooperation is rewarded with a better sentencing recommendation.
These are just a few of the reasons that your codefenant could get a lesser sentence for "the exact same crime". There are others and if you are in this situation you would be wide to discuss this with your attorney.