Depends on the account,
On ones I'm playing frequently, walls and traps tend to come last.
On ones I play sporadically, walls still usually come last, but I upgrade whatever I can afford to keep my builders busy which means bigger defenses usually come later.