Aside from the other good answers, there's also a much simpler reason: lab classes. CS and math are the only STEM fields I can think of where you won't have at least a few classes with labs where access to equipment and hands-on instruction are key.
I'm no longer in school (graduated a while ago), but I would make the same decision as the person you are responding to. What I liked about school was the social aspect that made learning easier/more enjoyable. It was nice walking into the library and recognizing a face from class to chat about what was taught. It was nice running into somebody while walking to class to chat about what was going to be taught/what was taught.
There is a spontaneous social element to the learning process that I believe can't be replicated online.
I disagree pretty strongly with this. For me, the social elements of college were pretty distracting and unhelpful to learning/earning my degree. Secondly, with technologies like Zoom, Slack, and general learning management software, it's actually very easy to collaborate with other students for studying, working on problem sets (when allowed), etc. And finally the cost of college is absurd. Even assuming that the tuition cost were the same, going online would allow for cheaper housing costs and would give back some valuable time.
Overall, I feel like online makes better sense for college education than in-person. But that's also my long-term view and I wouldn't expect an impromptu switchover like we're facing now to be the best. There are also a large percentage of degree programs that do require hands-on instruction like say, a degree in chemistry, which I agree would have to stay on-campus.