When the doses could be used, the US jealously guarded them, while the EU, Russia, China and even Cuba shared.
The 100 million doses that were "donated" almost two years later is a very poor excuse for hogging the supply when it mattered most.
As for the optics or donating - it was done only so that the US could say "we donated the most" while many, many countries actually supplied a lot more. Paying 3-4$ per dose is not an issue for almost any country, and when it actually is the EU, Russia, China et al. had no issues discounting or even donating them.