A bit more complicated than that. A declaration of war against a foreign government presupposes that there's a foreign sovereign to declare war on. The US didn't recognize the North Vietnamese as a legitimate government, and took part in Korea as part of a UN force, so a US declaration of war wouldn't have been appropriate.
For that matter, the US never declared war against the Confederacy, because its position was that the CSA was not a sovereign government, but a domestic rebellion.
I know it's legalistic nit-picking, but war is always a political act. And I will note that I don't see any international political reason -- though plenty of domestic ones -- not to declare war on Iraq in 1991 or 2003.
Yes, but legalistic nitpicking is the reason these deserters have no fear of the death penalty. Any lawyer worth his salt would argue that we weren't "at war".
Moreover, Congress has the power "To declare War, grant Letters of Marque and Reprisal, and make Rules concerning Captures on Land and Water;"... It says nothing about there being a foreign government being involved. The situation vis a vis Iraq and Afghanistan is little different from the war on the Barbary pirates.