They had that right of free speech until the federal judiciary used an "incorporated" First Amendment to silence their speech.
They represent the state. Their speech cannot be silenced, except when on the job. At least, my opinion is it shouldn’t be.
Otherwise, all government employees would have no first amendment rights. And at the rate we are going regarding the percentage of the country that works for the various branches of government, that would imply that soon no US citizen would have first amendment rights. ;)