I've done that with cities that I built myself, too. If it's a city on the outer edge of my empire, then it's not going to be a city with much in it. And it's much better to ruin one city, instead of losing the whole war. Think of it this way- a settler costs about as much as city walls, but it makes a much more effective defense.
I agree. Especially in ICS, it is much more effective to let a city fall than to lose units defending it. Often with an unexpected DoW, I will pull my units away from cities that are in danger while I wait for my army to arrive. First, enemy units take damage every time they attack your city. Second, it seems the AI likes to capture cities with their best units, so capture/pull out (with mounted units)/retake and kill their unit inside is a very easy way to deal with an AI that is technologically superior.
Because of that, walls are weak imo. If your city is captured, then you likely just wasted 500g or however much production it cost (the price to ally a CS...). They can be useful, but like you said, production/gold is usually better spent elsewhere.