A judge dismissed a lawsuit by Herbalife shareholders who claimed that the business structure and marketing practices of the weight loss and nutritional supplements company violated the law and that they lost money because it amounts to a pyramid scheme.