What is the purpose of the lottery in "The Lottery"?
By the time of the story, the purpose of the lottery is lost in history. Years ago, every community apparently performed a lottery ritual, complete with swearing-in, a chant and salute, and a formal recognition given to each person as s/he came forward to draw from the black box.
Perhaps, at one time, the entire process was seen as an offering of one person's life to the gods on behalf of the entire community. Perhaps it was a primitive form of population control. Perhaps it was seen as a means of resolving conflicts by ensuring that disagreements would never escalate to a serious degree.
At any rate, by the time of the story, the lottery serves no purpose but to fulfill the unquestioned tradition that required it. The people acccept it as an important procedure that must be followed according to the history from which it has drawn, not requiring any rational reason for its continuation.