Bad tasting ice can be caused by several different problems. Ice will absorb odors and begin tasting bad if foods are not wrapped and sealed properly in the refrigerator and/or freezer. If you suspect that this is happening, try dumping the existing ice, thoroughly cleaning the ice container and producing a completely new batch of ice from scratch. Thoroughly wrap foods to prevent the transfer of odor and taste to the ice. This may correct your problem.
Another cause of bad tasting ice could be a result of your water supply. If the water supply to your refrigerator has a bad taste, then the ice will also taste bad. You can check this issue by turning off the water supply to your refrigerator and disconnecting the water supply hose on the back of the unit. Take a sample of the water from the supply hose and see if it smells and tastes okay. If not, this is likely your problem. You may need a plumber to correct this type of problem or you could try installing a filter in the water supply line (see the image and link below for information on one type of filter that may work in this situation).
A similar cause of bad ice taste would be a build-up of deposits in the ice mold of your ice maker. To check for this, you may need to unplug the refrigerator and remove the ice maker. The ice maker module can be removed by loosening or removing the two screws that hold it to the side wall in the freezer. You will also need to unplug the wire harness connection (with the refrigerator still unplugged). If you pull the ice maker module out and find deposits in the ice mold, try cleaning them with vinegar and mild detergent. Eliminating deposits in this ice mold would likely prevent bad tasting ice.
If you need more help with this problem, resubmit your question with additional details.