It's a case of union protocols. And that weekend event seemed to have nothing to do with teachers, so he's not allowed.
I'm related to, and know, a small army of teachers, and one of them is a local union rep. As near as I can tell many of them spend a large number of their off hours at the school. In fact it's pretty hard to be a teacher and not do that even with no extra curricular activities, especially on the elementary side. So as much fun as the casual union bashing is... At least know the job you're talking about. In the midst of the summer I don't know many teachers that would be caught dead in their schools, but I imagine that many school boards would have a policy that would discourage teachers from coming and going willy nilly during the summer break when they have absolutely no reason to be there. FRANKLY, A GREAT MANY EMPLOYERS WOULDN'T WANT EMPLOYEES COMING AND GOING WHEN THEY HAVE NO BUSINESS BEING AT THE WORKPLACE.
Thoughts on "No teachers are allowed into the building during this time!":
0) It's not like the union rep guards the door of the school in the summer, or the union has summer staff to guard the schools. Could it have been custodial staff that knew the teacher and knew he had no business being there? (Some of the grimier custodial work often gets done over the break, AFAIK.)
1) Given that it's summer break in most places could it be somebody making a joke? (AKA- "Why the hell are you here?")
2) Could have it been some kind of 'summer fun' program that didn't want to be 'uncool' by having a teacher around?
3) Could it be some kind of private function that has no obligation to accept unsolicited offers of help from some random person?
4) Some places may indeed have policies about teachers not being in the school during the middle of summer break. That would be as much board policy as anything else, AFAIK. Teachers usually go back about a week before school starts on the elementary side.
5) I'm not sure, and it may be board and school dependant, if teachers can come and go willy nilly on the weekends during the school year, but I've been with teachers (plural) in schools on the weekends during the school year. I know the elementary side better, but being an 'average' teacher isn't an 8-4 job, and being a 'good' teacher takes considerably more than that, so teachers are often in schools at odd hours even without meetings, events, and extra curricular activities. It's a little easier to have a 'normal day' on the highschool side.
I'll ask the actual union rep when I talk to them, though they're not in the TDSB (but the are in Ontario). As likely as not, it might just have been a custodian following the summer protocol and not somebody who was involved with what was going on at the school (who would have no obligation to oblige the teacher anyway).