There's a lot happening in today's decision in Thakur v. Trump, by Ninth Circuit Judges Richard Paez, Morgan Christen, and Roopali Desai, but I thought I'd focus on the First Amendment analysis. To oversimplify, the Trump Administration canceled a wide range of academic grants "because of the recipients' perceived expression of DEI, DEIA [diversity, equity, inclusion, and accessibility], or environmental justice viewpoints." The grant recipients sued, arguing that such viewpoint-based cancellations are unconstitutional.
The law related to viewpoint-based conditions attached to government subsidies is complicated. On one hand, as the Court noted in Rust v. Sullivan (1991), "When Congress established a National Endowment for Democracy to encourage other countries to adopt democratic principles, it was not constitutionally required to fund a program to encourage competing lines of political philosophy such as communism and fascism." Likewise, the government can fund a program for promoting military enlistment, or recycling, or racial equality, without having to give grants for contrary views.
On the other hand, as the Court noted in cases such as Rosenberger v. Rector (1995), the government can't set up a generally available funding program and then exclude recipients based on viewpoint. For instance, it can't exclude religious newspapers from a funding program for student newspapers at the University of Virginia, or excluding anti-government or racist or pro-Israel groups from the 501(c)(3) charitable tax deduction program.