As elsewhere in life, discretion is important in the criminal justice system. Courts often have to deal with complex cases which don't result in easy answers. Yes, there are rules, but those rules need to be interpreted by judges according to the specific facts of the case. Far from the facts of the case being bent to fit the rules, the rules must be accommodated to fit the facts. A "one size fits all" policy in relation to sentencing, though more predictable, would undoubtedly lead to injustice, with disproportionate sentences becoming the norm.
Discretion is also important in that it allows judges to take certain policy imperatives into consideration. In some cases, for example, it may be necessary for the courts to show leniency because the prisons are overcrowded. At other times, the judge in a particular case may feel that a strict application of the relevant law would undermine its overall spirit, thus defeating its original intention.
On the whole, judges have a very difficult balancing act to perform. If they're too rigid in interpreting the law, miscarriages of justice may well arise. On the other hand, if they exercise too much discretion, they open themselves to the accusation that they are making the law, rather than interpreting it.