Why did my Troops Defend when they were set to Hide?
If you have recently been Attacked and noticed that Troops in your City Defended though you had them set to Hide, the Troops that fought were most likely not your Troops! Rather, they were Reinforcements.
When an Ally Reinforces one of your Cities, his or her Reinforcing Troops will Defend that City regardless of whether you have Troops set to Hide or not.
Keep in mind, these are not your Troops Defending. If your Troops are set to Hide, your Troops will remain Hidden while the Reinforcing Troops Defend. The Attack Report you receive is showing the Reinforcements that fought.
If your Troops were set to Hide, they did not fight.