WWI, probably not. WWII, yea.
Japan attacked us, and would have continued its expansionist policies to threaten our direct interests.
Letting Germany or the Soviet Union enslave all of Europe would NOT have been good for our national security, economic concerns and other interests.
It also gave us a jump start on military technology that was crucial during the Cold War. Would you really have wanted us facing the Soviets with a tech deficiency of a decade plus?
Were we not involved in WWII, the USSR would not have been a threat afterwards. It may not even have existed. Germany would have gobbled up the useful bits of the western USSR up to the Urals and set up satrapies. The eastern USSR had relatively little industry with which they could have threatened anyone not a Siberian subsistence hunter. Post-war for the USSR, had it survived, would have had a peril-filled existence what with China getting unified under Mao in 1949.
USSR was well and truly @$%^ed without both our "Lend-Lease" hardware (to include beau coup trucks to bring in the harvests and imperial buttloads of war materiel) and -eventually- another front to relieve the German pressure on them.
So, you would have had a German-controlled Europe from the English channel to the Urals...for a while. Until the locals figured out there was no way in Hades Germany could control such a mass of humans with its population. To keep control, Germany would have to have a great deal of cooperation from the locals. And were such cooperation forthcoming, how illegitimate would the satrapies then be? Any less than the USSR's? How about relative to the EU? Would a "premature EU
SSR" have less legitimacy than the current undemocratic EU?
===============
Yep, Japan attacked, so that was their *expletive deleted*ss. No stopping the American public from grinding them into paste after that, even if our leaders wanted to ignore Japan and focus on saving
western europe the USSR from the Hun. And I doubt that if Germany had refrained from declaring war on the USA we could have prevented our leaders from declaring war on Germany.
At the end of WWII we still had most of Europe in chains and the largest malefactor got rewarded for their savagery. Also, though the USA ended up a superpower, so did the USSR. And then we had Mao and N Korea and N Vietnam, too. The latter two would not have existed without a post WWII USSR superpower.
So, yeah, WWII did not do us much good for what we expended on it.