Imagine a freekick about 10 yards outside the penalty area. The attacking team may take a shot directly at the goal. Or they may pass to another player. AR is watching for offside. Referee is watching for possible fouls inside the penalty area. There are often 12-18 players in such a tight space in front of the goal. But when there is a wall, the FK may hit the wall. There is always a possibility that a player in the wall commits a handball offence.
If you set the wall by the penalty area line, it becomes very difficult for anyone to see if a handball offence was inside or outside the penalty area. Unless you are aligned perfectly to see where the offence happened, you, as the referee, will never know. Did the offence happen a few inches inside the penalty area? Was it on the line (considered inside)? Or was it just outside? This creates an added layer of difficulty.
To avoid the unnecessary confusion, many experienced referees would position a wall well inside or well outside the penalty area. This way, if there is handball, the location of the offence would be very clear. During the pregame pitch inspection, these referees would figure out where 10 yards from the top of the penalty area might be. Is there a tree that works as a marker? Is there an advertisement board? Having a marker allows the referee to know when an offence happened 10 yards outside the penalty area and to be smart about how to manage the restart.