If the money came from stock sales, it didn't come out of the company's funding. It isn't
that money that's funding this income. This income came from people who want to own a piece of the company's future success.
Now, I guess those people are anticipating maybe future profits to be made from NIH funds... but that's sort of the point of government grants to private enterprise. In return for putting their capital up to fund labs and equipment and research, investors expect to be compensated... and some of that compensation comes in the form of government contracts to produce lifesaving vaccines.