There might be practical reasons (they can't run away and the corpse is easier to dispose of) but was there a specific, maybe symbolic meaning?
Because bullets that miss don't evaporate.
The wall acts as a backstop, so you aren't just shooting up the town.
In some European cases, the man was tied to a post to keep him still, but there would still be a wall, if some distance behind. In some forts, the post was the one used for punitive floggings, and so in the center of a court.
In The Circus of Dr. Lao (1935), characters speak of execution by firing squad as "'dobe walling" someone, as in "Nobody laughed when they 'dobe walled him." You notice it requires a heavy earthen wall: a wooden wall won't do. Of course, brick or stone can be used, but they were rare in the revolutionary Mexican zone.