Let them build as much as they want, a super fortress even, but use a progressive cost system.
For ex; 1 foot of wall cost 100 gold, 3 trade goods, 8 man hours...the next foot cost 120 gold, 4 trade goods, 10 man hours...next foot cost 150 gold, 6 trade goods, 14 man hours... for a total of 370 gold, 13 goods, 32 hours to build 3 feet of wall
I just threw out stupid #'s but a sharply progressive formula would make one think about the importance of each piece of wall and help prevent spamming just to block movement,