I use the fly food that Mantis Place (a site sponsor) supplies with their flies.
http://www.mantisplace.com/#!product-page/c1cs/4cbb496e-8455-591c-f347-f5880d7f68dc
It's made with bee pollen, but it does also contain powdered sugar. With that being said, all plants produce sugar as a byproduct of photosynthesis. Fruits and vegetables have sugar in the form of fructose, which is broken down more slowly by the body than sucrose. In addition, fruits and veggies boast vitamins and minerals which also have fiber to slow down the digestion of their natural sugars, which leads to more stable blood sugar levels. Now, I understand that there is a difference between natural sugar, which occurs in plants and such, and processed sugar that is made from sugar cane. I'm no vet or anything, but the way I see it though, is, as long as you aren't using flies as your primary feeder, day in and day out, week after week.... then you should be okay. Mix it up here and there and don't ALWAYS supply flies which feed on a gutload containing sugar, and use other main feeders gutloaded with healthy greens primarily and you should be fine.
In the wild, a chameleon will eat lots of things that aren't exactly considered healthy for them, such as earthworms which eat dirt (yum) - how healthy is dirt? Or flies that have been feeding on dung? Or beetles that have been feeding on a rotting carcass? Lots of things aren't exactly "good" for them, but as long as you aren't feeding bad things consistently then you will probably be okay. Just compare to humans for a second --- I know we are TOTALLY different species, but still. If you have a bowl of ice cream one night a week, then you will live. A couple of nights a week, sure whatever. If you want to have ice cream a FEW nights a week, then cut the portions back from a whole bowl, to say, maybe just a scoop, and then have it a few days a week. You will still be okay. But say you eat a whole bowl of ice cream, every day, week after week, for a month or two..... You probably gonna notice a bit of a weight gain. Not good. It's called moderation; ya gotta have moderation. Lots of fly food contain sugars because the flies love to eat the sugar - but as long as flies aren't your primary feeder then I honestly think it will be okay. Like I said, I'm no vet, this is my opinion, but maybe a vet can chime in here. I just know that people been feeding flies to reptiles for a long long time using the same kinds of gutloads made with sugars and I've never heard of anything bad coming of it.