It's about maintaining appearances and the thin veneer of legitimacy for those gullible enough to fall for it. Same reason why the U.S. sent aid to Palestinians while helping Israel bomb them.
As far as Trump's motivations, he is a dementia patient motivated by greed and narcissism. Most of the things he does makes no sense at all. He has beef with the ICC, now they are his enemy. It's not that deep. There's a reason people call him Comrade Trump, because he is actively destroying the US empire and I honestly welcome it.