This is arguably good military strategy, too - the US has ample resources to allocate to finding novel or even one-off exploits on an ongoing basis, where some poorer powers might want to rely more on keeping secret existing exploits for a longer period. Perpetually making enemies' weapons obsolete.
Also, the US has a much larger attackable surface area and far more to lose in this domain. So it makes perfect, cynical sense if the US government wants internet security in general to be better.
Just like a naval power with strong international trade interests has reasons to keep shipping lanes open to all and to deter naval piracy.
None of this requires benevolence, it's all self-interested