What is important to realise about so much of Frost's poetry is that everything functions symbolically as well as literally. Here, in this poem, what seems to be a slight disagreement or misunderstanding about building up walls to separate the land of two neighbours clearly stands for something much bigger and can be related to a universal condition of humanity. Let us consider the lines that your question relates to:
He only says, "Good fences make good neighbours."
Spring is the mischief in me, and I wonder
If I could put a notion in his head:
"Why do they make good neighbours? Isn't it
Where there are cows? But here there are no cows.
Before I built a wall I'd ask to know
What I was walling in or walling out,
And to whom I was like to give offense.
Clearly we have two opposite views regarding walls juxtaposed here. The view of the neighbour, repeated twice in the poem, is that "Good fences make good neighbours," or, to put it another way, being clear of where we stand and what separates us from others is the way to ensure good relationships. However, the speaker of this poem asks why it is that humans need to create walls to separate themselves, and makes the point that every time you build a wall you wall certain things in and certain things out, which, in turn will cause offence to various groups of people. This section of the poem, therefore, and the poem as a whole, asks severe questions about the barriers that we construct that separate us from each other, and also makes us think about whether such barriers cause more harm than they do good.