The speech is protected, but foreign influence is not.
The US has a very long history of preventing and restricting foreign control of national media. That said, this has traditionally been applied to television and radio, not new media.
The thought being, people can say whatever they want, but if a foreign adversary has control over the flow of key information channels, that is a national security risk.