1)
Why would David be upset that they came close to the wall?]
1.
Malbim: (a) Normally, a siege is far from the wall, so if they will leave the city and chase them, they can guard themselves and not come within range of people shooting arrows or projectiles from on top of the wall, i.e. about a kilometer. (b) If they are in this range, they must be careful not to come close to the wall, for they can cast rocks on them. Even women can do so, like happened to Avimelech!