This line contains some figurative language and should not be read literally. The speaker and his neighbor are not witches that cast an actual magic spell on the stones to make them stay in fence form. Rather, this metaphor suggests that it is such a difficult job to get the stones—some of which are shaped like "loaves and some so nearly balls"—to stack atop one another that it seems as though some unnatural magic is required to get them to remain in place.
The speaker has already declared, in line 1 of the poem, "Something there is that doesn't love a wall," and he provides a number of ways in which nature or the natural movements of people and animals interfere with the wall's integrity. The "frozen-ground-swell" of winter shifts the wall's foundation and "spills the upper boulders" onto the ground. Hunters' dogs chase the "rabbit out of hiding" and, in doing so, leave gaps in the wall as well. In short, the wall is made to appear rather unnatural: in making the stones like "loaves" and "balls," nature would seem to suggest that they are not meant to build walls with. Characterizing the mending of the wall as something that requires a "spell" further supports the idea that the wall is unnatural and not really meant to be there.