Exercising while being ill is not something you want to do. Just imagine what your body is doing:
1. Fighting a virus/bacteria, your immune system is going nuts
2. Elevating the body temperature to drive out the sickness
3. Using insane amounts of carbohydrates to fuel the "war"
There are more things that happen, but that's the jest of it. This isn't including the energy your body needs to maintain itself.
You won't gain weight while being sick, it's actually very hard to do since fighting off the cold/flu is like an internal cardiovascular workout for your body 24/7 until it's gone. What you're probably feeling is the breakdown of muscle tissue, which is normal if you don't exercise after awhile. Which really sucks for us guys, the first day back to the gym after being ill is like working out for the very first time