You left out the part where Stanford patented the results of the research, thereby monopolizing it.
Likewise, Google did not create untold billions "out of thin air." Google created untold billions by leveraging NSF-funded research, and the patent which Stanford licensed to them, in the midst of an explosion of new opportunities which was created when the NSF lifted commercial restrictions on the use of the Internet (which had also been built with public funding).
I know Americans like to imagine that even acknowledging the public sector exists is the same thing as surrendering to the USSR, but the USSR doesn't even exist any more, and there's actually a lot of merit in being aware of history and being honest about how economies work.
Just like putting a man on the moon, the Internet was a massive public research project which succeeded wildly. As OP says, America likes to tell a "hands off the market" story about how its government relates to its industries, but that story doesn't match the reality.