Sorry, I guess you misunderstood. The Espionage Act is EXACTLY THAT KIND OF LAW.
If you write or publish something that contradicts the government narrative, you can go to jail.
I suggest you google "Uhuru movement charged".
These are black American activists who are being threatened with prison for " conspiring to covertly sow discord in U.S. society".