The game is designed to allow city transfers to your allies by emptying them (0 troops) so your ally can claim them.
If your ally takes them without permission, learn from the experience and be wary of that particular player. The more experienced players simply don't engage in this kind of behaviour, but at your rank it can happen from time to time, so just be cautious and leave a troop behind in all your key cities and capitals.
----