At the beginning of Chapter III of The Great Gatsby, Fitzgerald's narrator writes:
In his blue gardens men and girls came and went like moths among the whisperings and the champagne and the stars.
As noted by handbooktoliterature, Gatsby's guests resemble moths in being attracted to the lights of the party as moths are attracted to flames. Like moths, Gatsby's guests mostly come out at night. They are night creatures. They are also ephemeral creatures. Their lifespans are short. They are somewhat mysterious and also usually anonymous. Like moths, they are all pretty much the same in their appearance and in their behavior.
The women would seem especially moth-like because in their loose flapper dresses they could be said to be fluttering around within the lighted areas. The men would probably be wearing darker and less flashy clothing, but they might be said to be fluttering around the women who are fluttering around the lights.
The guests are very active because of the dance music and the party spirit. In this respect they resemble the ceaseless movements of moths which seem so desperate to get at the source of the light that they appear to be almost mad. The fact that many moths get burned when the light they are attracted to is some sort of fire would suggest that what these guests are doing is dangerous too. It is dangerous because of all the drinking, which could lead to all kinds of trouble. Drinking was a new experience for a lot of people during Prohibition, and consequently many of them did not know how to handle alcohol. The fact that all the lights can attract guests like moths suggests that the guests are as mindless and frenzied as moths.
Nick Carraway's description of the guests as resembling moths as they came and went is based on his observation from a distance. At first he only observes Gatsby's parties from his neighboring cottage. The guests might look more like moths from a distance. A few pages later Nick is describing them from much closer range, beginning where he writes:
I believe that on the first night I went to Gatsby's house I was one of the few guests who had actually been invited.
This description of the parties in Chapter III is remarkably well handled. From Nick's point of view we see the parties at a distance and then, still in his point of view, we are drawn in for a closer look and are soon surrounded by people. They no longer seem like moths but are taking on individual identities.
This is an interesting one.
Generally, I would say the guests are like moths because they are attracted to the lights of a party like a moth is to flame. They show up seemingly from nowhere and pester around Gatsby's home while there are good times to be had during the warm summer months.
Moths are also known for ruining clothing and material, eating holes through different fabrics. The guests certainly provide nothing and take any material thing that Gatsby is willing to offer.
Gatsby is a bit of a moth himself through his attraction to the unattainable green light.