Because they're pragmatic.
Imagine if you were a part of the Manhattan Project, and success depended on (or could be accelerated by) secretly buying some Japanese or German centrifuges through a third party.
We'd probably consider that a good move, right?
China would obviously like to make nVidia irrelevant in the long run, but the billions of dollars nVidia got from Megaspeed weren't a significant portion of nVidia's revenue. A minor win for nVidia, and a larger win for China, is a net win for China.