I had always assumed that the walls were both a method to assert property claims and as a convenient means of storing the rocks when removed from the fields, which is the most common walls we find in the midwest USA.
It is actually pretty easy to ascertain the builders motivation by evaluating the construction of the wall. If it is dry stacked with plain field stone and no evidence of work by a stone mason; the wall was put there as a good use for the rocks that were picked up nearby.
Stone fences like this:
Scene from the Flint Hills of Kansas
-which curiously, have no flint whatsoever! They are all limestone.
If, however, the stones are cut to fit, or there is mortar between the joints, then it was built by a proud property owner that wished to invest in maintaining the property line.