I've never considered them a bad thing in compost heaps, they are there because something in the heap attracted the mother to lay her eggs there.
Since fly larvae are one of natures decomposers there is probably something in the heap that isn't decaying as fast as it
should, but that also isn't really a problem, with the troops all working together, you will end up with good compost.
My compost heaps are full of beetles, larvae of several different species, lizards come by to feast on many of these insects, so they are helping my compost decay and feeding our lizard population.
Redhawk