If you buy into the idea “America is the greatest country on earth” or even if you think “America is flawed, but ultimately a force for good” then you have to demonize China and Russia to justify your world view. Hell before I became a full leftist, I was definitely in the camp of “america bad, but better than everywhere else.” In that mindset, it’s very easy to say your against American militarism but then support it because “bad guys.”
Being American and being proud of it relies on a lack of self-reflection.
That makes the most sense to me. I have never felt particularly “American” and always thought patriotism was sort of dirty, but I grew up Catholic during the abuse coverups so I definitely know what it’s like to search for the tiniest bit of evidence that your in-group is more good than bad. I still catch myself slipping into a weirdly defensive mindspace when protestants go off about “pope worshippers” even though I have no current ties to religion, and I guess that just proves your point.