You are right, you should not be getting mad at him.
Being a child, at this age, he is busybusybusy at school/home and so engrossed in play that he's not listening to his body's cues. Or he is thinking that "maybe, I can hold it long enough". Testing of this capacity (holding urine or feces) is pretty common at this age.
This is his challenge to deal with. How you can help him: let his teachers know he is having accidents at school, and that they need to *send him* to the potty regularly. This is different than *asking* if he needs to go. I've learned this over many years of working with kids: they need to be told. And at home, if you suspect that it's been a while since he's used the toilet, you too can just tell him "It's time to use the potty" and send him.
I do this with my son (he'll be four in April) pretty consistently. If it's been over two hours or so, I just tell him to use the toilet. I do wait until he's at a transition moment (when he's not heavily engaged in play), and I watch for these moments. I've found this is most effective for me, personally.
And with the preschool group I teach, I have a pretty clear guideline: if they wet themselves and want to change right away, I'll often wait on starting storytime or a group activity they love, so that they can change their clothes. When they *don't* tell me their pants are wet, and I have to discover it myself, they know I will not wait on those activities, but proceed as usual. It's part of their job at preschool to take care of themselves, and that means changing their clothes when they are wet.
Let the teacher know that your son is needing more direction with this, because the teacher should be able to step in and help him (as much as he'll comply) through this time. Kids have accidents, for sure, and we can help them through this by being 'the reminders'. Remember, they are still pretty little and have different priorities than we do!