"Going to University" implies partaking of a course of study at a university.
"Going to Hospital" implies "is a patient"
Going to the university would be used if the speaker & audience both already know which university is meant.
It could also mean physical presence at the university, but not attendance on a course.
My sister is going to university, she is a third-year Electrical Engineering student.
My dad is going to the university today. He is going to un-block some pipes. Next week he is going to the hospital to install some new bathroom fittings.