And similarly peace isn't possible while the wall is there. Although the reason it was built was because there wasn't peace. And so on about a thousand years back.
The most obvious thing that motivates Palestineans to actively be violent rather than living in misery (and people can take a lot of misery) is that ongoing settlement and similar measures make it clear that the Israeli government wouldn't actually let them live in peace even if they wanted it.
Or, in other words, I believe that Hamas would have much less pull if it was just walls and not all the other stuff too.