I suspect that in some cases it does. Fear of the law probably does a decent job of keeping most people from enjoying alcoholic beverages on sidewalks for instance. (but I also suspect that in many cases (if not all cases) the imprisonment could be replaced with other punishments. Punitive damages are one obvious example of non-imprisonment punishment.)
In cases like Charles Manson, I doubt punishment is valuable. Crazy people aren't exactly known for their fear of consequences. If this is the case, then punishment of Charles Manson would be pointless and frankly verging on barbaric (though detainment of Charles Manson would of course be absolutely essential).