Since the USA has more prisoners per capita than anywhere else in the world, I think we’ve pretty much failed as using jail as a deterrent. It really is all about punishment and removing those from society we don’t think deserve to live a free life (see the failed drug war).