The answer is that we don't know for sure. The most popular theory is that insects that fly at night use the light from the Moon and stars to help in navigation. When the Moon is visible, the insects fly perpendicular to the light. That keeps them fly in a straight line. A bright porch light confuses them. As they try to fly perpendicular to the light, they wind up spiraling in towards the light.
Another possibility relates to the white color of night blooming flowers. Those flowers reflect ultraviolet light from the Moon. Since insects are very sensitive to ultraviolet light, it is easy for them to see the flowers. The bright light of a porch light may seem to be a super big, super bright flower.