If you worked at one of those institutions, though, you'd add an article and be specific - you work "at the university" or "at the hospital". (You'd expect the listener to infer that you mean the specific university/hospital in the area, assuming there is only one.)
Edit: More colloquially, we also have "going into town" (no article, even though it's probably a specific town that is clear from context!)
The article-less usage only seems to work for generic places (hospital/school/prison/university). It doesn't belong with a noun that refers to a person but also sort-of-refers to that person's place of business. You're "going to the doctor" or "the dentist" or "the hairdresser" - never "going to doctor". This is despite the specificity often being superfluous here - the listener might not know/care which dentist you use!
He’s gone to hospital. (Hospital is abstract, we don’t necessarily know which one)
He’s gone to the hospital. (A specific hospital, either inferring which one by context or prior knowledge)
You don't go to store though, hang out at mall, meet at restaurant, or go to bar for a drink.
I think the difference between the two usages is considering "hospital" an institution.
I also don't think a vs the requires the listener to know which specific place you're talking about, it seems to also communicate that the speaker knows what place they're talking about. "I'm going to the store to buy carrots" vs "I'm going to a store to buy carrots." Someone knows vs no one knows.
Likewise "went to school" (as a scoolchild) vs "went to the school" (to collect someone, or to teach). "At university" (a student) vs "at the university" (physical location, for any reason). "Went to prison" (as a criminal) vs. "went to the prison" (to visit his brother, or to fix their telephones). "Does she go to church?" (to church services) vs. "did you go to the church?" (to see the stained glass).
"Go to the doctor" is a bit different, the doctor isn't an institution, he's a person. Although I think that implies you went for medical reasons, if you stopped by to pick up some paperwork, you might say "I have to stop at the doctor's" i.e. his rooms. But maybe that's also because you would probably talk to the receptionist anyway. But "went to the barber" implies you had a shave, while you might "stop at the barber's" to pick someone up.