Why do armies fight so hard to capture cities that are completely destroyed by shelling, fires, bombing etc? What's the purpose?
Can have many different reasons,I will list up here some but since your question is not specfic, I also cannot answer you specifically, but anyway I will provide some generic examples so you can better understand:
- The ruins might contain one or more persons or equipments you might want to destroy in order to win the war (e.g. the commander of your enemy hiding in a city even though it is already in ruins)
- The place of the ruins might be strategically important because of geography (e.g. important sea coast)
- The place of the ruins might be strategically important because of assets (e.g. important ressources like oil)
- The place of the ruins might be strategically important because of infrastructure (e.g. located on the only street to another important places)
- The place of the ruins might contain people and weapons who are willing and capable to disturb you and attack you from behind when you ignore them (thats why as an army you do not go just around castles, you have to conquer it or the castle will eventually conquer you)
- The place of the ruins might have a significant propaganda importance (e.g. you cannot afford to lose Mekka to a non-islamic country without weakening the morale of muslims)
- Your enemy might actively send reinforcements to these ruins in order to keep you fighting there on purpose (e.g. in order to prepare a strike on another point of interest which is now not-so-heavy guarded since you have all your troops fighting in these ruins)
- It is better to pick an already devastated battle ground over a unharmed city full of resources and people, if you plan towards using these resources and peoples after the war and they do not have to be destroyed in order to achieve that (after all, your goal is usually (1) to stop the resistance of the enemys soldiers, not to destroy cities or civilians)
TL:DR - Battles are not about conquering cities. They are about conquering power.
(1) except you actively plan to harm civilians and destroy cities even though they offer no resistance