For many years it was thought the moon did have something to do with the attraction of moths to light. The so-called light-compass theory held that moths used the moon as a navigational beacon. By keeping it at a constant angle to their direction of travel, they were supposedly able to fly in a straight line. The trouble (for the moths) came when they made their sightings on a close-up light source like a candle flame. Instead of heading in a straight line, they flew around the flame in an ever-narrowing spiral until finally, phhhht, moth flambé.
[..]
Others claim that, to the moth, bright lights mean open space and open space means safety.