The use of a setting can be very important when developing a story.
1. The Lottery-
In Shirley Jackson's short story, The Lottery, the rural setting of the story feeds into the realistic nature of the story itself. Here, the rural setting allows readers to accept the fact that a human sacrifice happens in order to insure that the crop is good. If the lottery took place in any other place, it would not support the action of the text and would fail to develop properly.
2. Of Mice and Men-
In John Steinbeck's novel Of Mice and Men, the setting takes place on a ranch during the Great Depression. Given that the life of the rancher and his pursuit of the American Dream, the only place the novel could be set is in the wilds of the open land.
Walter Dean Myers novel Monster could not take place in any other setting than a courtroom and a jail. Given that Steve Harmon, the main character, is on trial for murder, the only setting suitable is the one which the novel takes place.