It is the opposite actually
A max defense th9 with level 7 walls, will most likely rank higher than a untaxed defense th9 with lvl 8 walls. If you want to win wars, do walls and heroes. Defenses (in my opinion) should be don't AFTER your walls are formidable. This only really matters war wise for th9+, however th8 should do skulls in a reasonable time.
War upgrade plan:
If you are a th9, I would recommend AT LEAST 100% legos before doing defenses to new levels. This may include Laval if you wish. Also, max your troops that are important for war (hogs, golis, hounds) with de FIRST. Then put ALL of your de towards heroes.
For a th10, I would recommend at least having some Laval before doing defenses. You need heroes around 25 each also.
ALSO, the anti 3 base in war (only style of base that won't get 3* as a th9) is really only useful with strong walls, as this takes away the possibility of gowipe/gowiwi from ripping through your base. This complimented with a well designed base, can be a extreme challenge for an attacker.