Like all units, Wall Breakers choose the nearest "preferred" target, in this case walls. Since you don't have direct control of any units, nearest is determined by some type of aggro algorithm.
At first I thought they just walked in a straight line to the nearest wall, which makes wall building fairly straightforward. As I've risen in the ranks I've seen more exotic wall designs, which are clearly designed to "lure" Wall Breakers away from the main defensive walls. When this is done correctly it makes Wall Breakers almost useless, because it would take way too many to clear out the "lure" walls.
I'd love to use this strategy myself, but I'd like to get it right on the first try. So how exactly does Wall Breaker aggro work, and what patterns can I use to effectively build "lure" walls.
Best Answer
Well.. rarely do you get a more definitive answer than from the developers themselves:
The two main takeaways from this that are interesting:
1. You can no longer lure Wall Breakers with "vestigial" walls.
2. Wall Breakers target the nearest enclosed building. Some have found that you can confuse them near the edge of your main village by enclosing something like a builder hut or tesla. ¡Viva the AI abuse!
Edit:
As added info, I've found this video from Flammy extremely informative. He shows the Wall Breaker aggro in action, and even has some crude measurements of aggro distance.