It is also pretty common for large companies in the US to have some sort of dining services, for what it’s worth. (I’m surprised this isn’t a thing in Europe, off the cuff “cafeteria” doesn’t look like an Americanism to me, but maybe it is).
Dining services for students make sense to me. Students are generally young folks with a lot going on. They might be on their own for the first time. It is helpful to have a place where they can just go grab some food without too much thought. Dining services might be priced into the student’s tuition, so parents can be confident that their kids will get meals, rather than spending their budget on partying, haha.
Plus, actually this is probably a more practical reason and I should have lead with it: dorms usually have limited cooking facilities. And imagine the messes which would be created in the shared kitchen, if everyone was using it. Eating out is nice, but most people don’t do it every day. Dining services handle the unexciting daily meals well — so really, this isn’t a redundant service to local restaurants.