[Both Japan and Germany declared war on the United States. See the difference between that and Ukraine?]
The US was funding and arming Japan’s and Germany’s adversaries before they declared war. And there was obviously no real need to take their capitals over what was at worst a border clash from the US perspective. Germany never stepped foot on US territory. Japan took Guam and Wake Island. Spain certainly did not try to take DC over the loss of Cuba, Puerto Rico and the Philippine Islands.