Flagship and land-grant universities lost millions of dollars as institutions tried to make it safe for students to be on campus during the pandemic.