A Pennsylvania federal judge on Tuesday curbed the reach of an antitrust case that dozens of states brought against generic drugmakers, ruling that New York, California, Connecticut and other plaintiffs were barred from pursuing alleged ill-gotten gains as a penalty.