The is not used in expressions such as ‘go to school’, ‘go to church’, ‘go to hospital’. There is an ‘inherent’ connection between the speaker/ listener with the place such as student, believer, patient respectively. If not, the reference is to just the building and in that case it should be ‘the school’, ‘the hospital’ etc.
E.g. The children go to school.
The mechanic went to school for repair work.
The only exception to the above rule is ‘go to the office’.