Your first link involves laws passed by Congress. But there is no relevant law that requires "viewpoint diversity" (whatever that means) or most of the other demands in the government letter, this is simply an executive diktat.
Your second link involves a change in IRS policy. But there was no such change, instead again we have an executive diktat, despite the fact that the law explicitly forbids the President or his office from targeting specific institutions for audits or investigations: https://www.law.cornell.edu/uscode/text/26/7217
But it appears that there's a giant loophole - the Attorney General apparently can still do so:
> (2) any individual (other than the Attorney General of the United States) serving in a position specified in section 5312 of title 5, United States Code.
Whether Congress does it or the executive does it isn’t relevant to the first amendment question, which is what I’m responding to above.