100 turns ago (25 years ago) one of my units approached an enemy city. Since then I have always been able to see what kind of units are inside and I thus been able to prepare a battleplan from the comfort of my castle, in another continent.
I believe that having the content of a castle be completely invisible would be realistic, but would also make very hard to prepare for the fight. In Age of Wonders units are visible inside an enemy city as long as that city is in the visual range of one of my units. In Total War the number of units present inside a castle can be visible, but their specific traits are hidden unless a spy is succesfully sent inside.
Another possibility would be that in order to see the content of an enemy city one unit should be right next to it, or that special units (scouts) should be close to it. Whatever choice is made IMO things should be changed.
It's the kind of thing that makes this game's strategy feel simplistic.