Jails in England and Wales cannot be allowed to become “factories for making bad people worse”, PM says.