America, since the Nixon administration, through the Cold War and after the dissolution of the USSR has promoted global cooperation as a tool for stopping authoritarianism at the source. We help nations with their AIDS crisis because it means they are fundamentally more stable and can use their government to focus on problems they're equipped to handle.
America doesn't have to help anyone. We can always kick back on our lawn chairs, take the taxpayer-funded pontoon out on the lake and watch the world burn from a safe distance. But we don't do that, because when we do we prove to the world that we are exactly the evil and selfish caricature of a nation they think we are. After all, if America doesn't formally offer to help they might seek out an even more destructive solution (see: IMF loans, centralized planning, coordination with adversaries, etc). Then you'll be wishing we bought the condoms for them.