Because of the importance, in the novel, of the clash between old money and new money, the settings of East Egg and West Egg and what they each represent are important. It is not impossible to imagine other places where this same dichotomy could exist, but in the 1920s in the United States, this was certainly a good place for this type of story to take place.
Fitzgerald uses the differences between the various places to bring out or emphasize certain themes so setting isn't just important in the general sense. When Fitzgerald has the characters travel through the valley of ashes, he is indicating the death or corruption of the American Dream, a theme that runs throughout the novel. Because the wasteland exists between the opulent and controlled setting of East and West Egg and the more cosmopolitan, frenzied atmosphere of the city, the particular nature of it serves to emphasize the corrupted nature of both places.
So again, it is possible that the story could have been set elsewhere where these similar conflicts between old and new money existed or where the author could emphasize the corruption of the idea of the American Dream, but these are considered particularly effective given the ease with which many readers could identify with them.