If we say "I went to university", the purpose that I went was by default i.e. study.
But if we say "I went to a/the university", the purpose that I went is something else.
For example,
- "I went to a university in CA to take a photo"
- "My mom went to the university to meet her friends there."