From the opening lines of this poem, Frost establishes that walls must be actively maintained or else they will erode away. People willingly devote their labor to this, but why?
The reader is presented with several possible answers, but they seem inadequate. The fact that people persist building walls suggests that it is in our nature, and because it's in our nature, we can expect to see this happening both between individuals and between large groups. In essence, Frost forces the reader to arrive at this conclusion by process of elimination. Here, he suggests, is a case where the material and economic reasons don't justify a wall, but the men continue to maintain it anyway.
The narrator has an apple orchard; his neighbor's land is "all pines." There can be no mistaking where one property ends and the other begins. It's demarcated by these natural features, and, as the narrator notes, there is no threat of encroachment:
My apple trees will never get across
And eat the cones under his pines, I tell him.
Maintaining a wall would make sense if one of the them kept cows. Then there would be a need for a physical barrier to keep them from roaming away. They don't have cows, though, so there seems to be no economic reason for a wall.
Moreover, the neighbors themselves are on friendly terms, so there seems to be no reason to fear trespassing. Maintaining the wall involves a good deal of hassle and labor. It is damaged by hunters, natural forces, "elves," and whatever else there is that "doesn't love a wall."
Yet both men, the narrator included, invest time and labor into fixing the wall. The narrator's comments indicate that he recognizes the futility or silliness in the task, but he doesn't refuse to repair the wall. The poem suggests the neighbors meet to fix the wall every spring, and it appears this year will be no exception.
Something else must impel the men to maintain the wall. The narrator's reference to his neighbor appearing as an "old-stone savage armed" suggests something primal in the act, something intrinsic to human nature. The neighbor's reasoning is that "Good fences make good neighbors."
The narrator is critical of this comment, noting that his neighbor is simply repeating—without reflection—something he heard his father say. It's the only explicit answer to this question that hasn't been refuted during the course of the poem, and it is repeated in the last line.
The reader is left to ponder why good fences make good neighbors. Since it is not because they require a physical boundary to keep track of the property line — and not because they fear trespassing or the loss of wealth (cows) — it would appear the answer concerns human psychology. Even if there are people who question the need for walls (as the narrator does), they, too, will conform in order to keep good relations with their wall-loving counterparts.