You're never going to stop many of them from reoffending. Even the "best" rehabilitation programs have crime rates far above the general population.
The additional 10 years is 10 more years where they can't hurt innocent people. The justice system exists for the benefit of society and innocent citizens, not criminals.
> assuming that doesn’t cause more people to do it in the first place
Why would you ever assume that? Punishments absolutely have a deterrent effect.