Since there seems to be some confusion on how destruction of a structure ends wars, I’ll just post this snippet from the devblog for clarification.
As mentioned above, organizations must be war eligible in order to declare wars, have wars declared against them, or join an existing war as an ally. If either the attacker or defender of an existing war loses their war eligibility due to their final structure being destroyed or scooped, the war will end 24 hours later. If one side of a war loses their last structure during the 24-hour warmup period before a new war allows legal combat, the war will end 24 hours after the end of the warmup period (so combat will be legal for 24 hours total).