I can't look into the minds of the designers. Maybe it was a programming error, but it could just as well be working as designed. Walls and castles don't get their damage reducing effect anymore and can be bombed away quickly. But in some way they still exist and thus need to be bombed away. After castles and walls have been obsoleted for the defending party, they won't have to be bombed away anymore.
They are useful when the city has a low culture defence bonus until they are obsolete for the defending party which happens some time after the invention of gunpowder. If the attacking party is more advanced, the defending party will profit from the walls and castles relatively long until they also develop the technologies for obsoleting walls and castles.
It's a bit of a weird system and I wouldn't have designed it this way. Primarily because it is very confusing. I guess only a few percent of the players on this forum know about what I wrote in my previous post and the players on this forum are probably much better informed than more casual players.
I mainly wrote it so that it is clear that it isn't an issue with this mod.