Diagnosis
Odors and tastes are leaching from the plastic water reservoir or tubing into the water, then into the ice.
How to Fix It
Perform a deep deodorizing clean. Run several cycles with a baking soda solution (2 tablespoons per tank of water), then run multiple flush cycles with fresh water until the taste is gone.
If That Didn't Work
The charcoal filter (if your model has one) is saturated and needs replacement. More commonly, you're using a scented cleaning product. Only use unscented, food-grade cleaners like vinegar or citric acid.
Heads Up
Never store the ice maker with water in the tank. Always empty and dry it completely, or the stagnant water will cause a permanent foul taste.