Correct me if I'm wrong but I think the ambiguity is between "at the school" and "at school". The difference is very subtle and depends on the "status" of the person who is talking ie someone who is usually at this place or not.
Example 1 for someone who is usually in the school (students, teachers, etc) would say:
The students were at school when the it was raining outside yesterday.
Example 2 for someone who is just a visitor of the place would say:
The parents were at the school on the occasion of the Open Day.
The same rule will apply to hospital, prison, etc.
My uncle was brought to hospital because he broke his leg.
vs
My uncle drove to the hospital to visit his wife who were injured last week.