But not churches and basically it incentivizes schools to cut enrollments to get under the 3K students that qualifies for the tax. So you will end up with less slots in private schools and flood the public schools
So it's quite literally done to punish Democrat states with lots of college students.
Note it is taxing the endowment not the donations so if a school already has a huge endowment it's going to tax the existing endowment. One story I read said it exempts schools with religious connections so for example BYU would be exempt but Harvard wouldn't.