Consider the following scenario.
Unit X has been in a fight and suffered casualties. It used to have 9 fighting men, but the unit has been wounded down to 337/545 hitpoints, and only 6 remain. Still a fighting force, to be sure.
Unit X enters a city. The city bestows the unit with +100% hitpoints. Unit X now has 337/1090 hitpoints. 3 fighting men leave the unit at the end of the turn, and Unit X has been reduced from 6 fighting men to 3 fighting men.
Now an enemy invades.
Situation 1: I move my unit outside the city, and engage the enemy. My unit loses its city bonus, and falls to 337/545 hitpoints. I re-gain the 3 fighting men, and the unit enters the fight with 6 fighting men.
Situation 2: I stay in the city. and the enemy invades. The unit enters the fight with 337/1090 health, and 3 fighting men.
Clearly, the intent of the city bonus was not to reduce the strength of the defenders. And yet, this is all that it accomplishes.