On-campus dormitories provide locked front doors and security for first-year students. Programming is also available on some campuses to provide activities for students so they have things to do outside of studying. Dorms are safer than off-campus housing with less crime and more structure while still allowing the freedom to live as an adult.
I believe that on campus dorms are safer for student because there is more security inside the dorms, on campus walkways and school buildings. There is also check-in processes for dorms past certain hours which would almost eliminate any sort of robberies. Each hall is also monitored by a RA to insure kids are complying with dorm rules set forth by the university.