Your body recognizes that putting food in your digestive tract is a bad idea right now for whatever reason (the most common one is that you don't want to give more nutrients to the infection, which will make it harder to fight off). The means for it to signal this to you are limited to making you vomit whatever you eat, curbing your appetite, and, indeed, making everything taste awful.