I think you're actually struggling more with the idea that the First Amendment is a restriction on government, not on employers generally.
But the most relevant thing that you don't understand is that government employees are NOT supposed or allowed to act in partisan ways. Your suggestion seems to be that's the point of the job. In fact, that type of activity is prohibited in their official functions and can even be illegal.
As an example, if an agency wanted to perform a marketing campaign, and you decide to do go off script as an employee, you can be fired. There is no legal right to say whatever you want in the context of the job.
This was about partisan speech being compelled by government, which in fact most government employees aren't even allowed to engage in on the job. They are legally required to act in a nonpartisan way.
Failing to act in a nonpartisan way can result in Hatch Act violations, ethics investigations, or even criminal penalties. So yes, having the federal government compel them to engage in partisan speech is a problem.
As for the Hatch Act I believe that the administration is 100% in violation, but it doesn't seem like a 1A violation.
If that were the entirety of your argument, I'd actually be in agreement with you. It wouldn't surprise me if this decision got overturned on those grounds.
But on your second point, the current Court expressed its views on compelled speech and the First Amendment as applied to government workers in the Janus decision and this judge is merely following that precedent. It is stated very clearly in the decision.