The insects still orient themselves towards the sky, as it's the brighter hemisphere. They're not locking directly onto light sources, just using them as a cue for orientation. But that fails when the reference point is not distant, as with an artificial light.