I guess part of the answer might be that building a stone wall is different from chiseling a stone floodgate down, and one task wouldn't make you better at the other, but that just raises the old question of why the same labor is used for those two very different tasks, as well.
And why building a forge gives experience, but building a wall doesn't.
The logic is meta-logic... If it trained masonry you could endlessly designate and break down walls/etc for infinite easy xp.
Of course, now you can just do the same with workshops, so it's kinda pointless.
I fail to see how constantly building and breaking down walls would fail to make one better at either building or breaking down walls in the future.
...The same way building lots of mugs/flood gates/whatever helps make you better at building mugs/flood gates/whatever in the future.