The law is clear. If you mishandle, distribute or disclose classified information you can get in big trouble. In the worst cases, as with Jack Teixeira, the 21-year-old Air National Guardsman who has been accused of divulging top secret national security documents, you can be arrested, charged under the Espionage Act and, if convicted, sent to prison.
But in the court of public opinion the calculation is often less cut and dried.
Out in the real world, people who divulge government secrets are sometimes viewed as traitors or spies, but at other times, they're hailed as heroes, regardless of their legal culpability. Still other times, they fall somewhere in between.