The flags were designed to wave in the wind, giving the illusion of movement even in a vacuum. The telescopic pole used to extend the flag created a slight ripple effect, making it seem like it was waving. This effect was further enhanced by the stiffening of the fabric from the sunlight.
So, while the Apollo missions did not leave the flag waving in the wind, it did appear to be waving thanks to the clever design and the effects of the vacuum.