Let’s say your average class size is 20 people at a good school and a professor costs the school 200k including benefits per year. Assuming a student takes 18 credit hours and a teacher teaches 12 credit hours that balances out to ~15k per year. But, more than 2/3 of what a teacher spends their time on is outside the lecture such as grading assignments etc. So, removing lectures only saves ~5k per year.
Sure the physical room adds a little, but the average teacher is also far less expensive at most schools.