Full descriptions of DHQ and DF:
Arsenal -> Base -> Defence HQ
Grants Defence Points and sets maximum level of defence structures and units. Unique building (cannot be placed next to other unique buildings).
Arsenal -> Base -> Defence Facility
Access to defence structures and units. Repairs defence structures and units for up to 70% of hitpoints lost during last attack (efficiency decreased with structures / units above Defence Facility level). Unique building (cannot be placed next to other unique buildings).
---
So, DHQ Grants Defence Points and sets maximum level of defence structures and units.
And thats it. Nothing more.
---
These descriptions must have been what the game designers gave to the programmers. And they originally implemented it correctly according to the descriptions.
In this game you are allowed to sell buildings. So when defence reaches level 65 you sell DHQ. Acccording to the description, it is now useless.
This is NOT a loophole or a game bug. It is just doing as the DHQ description says.
---
Then an upgrade changes the function of DHQ, but you don't change the desciption to reflect the changes.
That is a blunder by EA.