That is the way it works for a private institution, but not for government institutions. It is supposed to a safety net to prevent the government from consolidating power by putting their thumb on the scale of public discourse.
That may be so, but the article gives the impression that the professors were forbidden from testifying, presumably under threat of losing their jobs.
If they were simply not allowed to take payment for that testimony, the article and title should reflect that, regardless if such a policy is also wrong.
And I would have liked for the article to elaborate more on this barring. What would happen if they testified anyway, if they did or did not get paid for it, etc.. It is after all the central issue of the article, and that they leave it so vague is either incompetence or deception.