Walls are useful in the early game, particularly for a PRO leader. It takes catapults a long time to knock them down, that buys you time to react to a surprise invasion and get your forces in position. I guess you could say the same thing about castles...they do take a LOOOOOONG time to bombard down. Personally I never build them but I'm sure it wouldn't hurt to have one or two in key cities if you get engineering early.
I can't tell you how many times I'm fighting a war on one side of my empire and my neighbour on the other side gets jealous and wants to join the party. Even though my army is huge and I could take both on, it is not evenly distributed. A couple of turns of bombardment is a couple of turns to whip/draft/run units to where they're needed, it can be enough to save a city, and remember that the AI does raze cities from time to time, you might not have the chance to take it back.