Toddler acting up at school

Amanda • Trying for baby #3!
I need some advice/reassurance. My almost 3 yr old has recently started acting up at school. Say for the past 3 weeks. He keeps running out of the classroom and opening the door to the outside. 
We found out he was acting up on Thursday but his teacher said it had been going on for a few weeks. So on Thursday we told him if he acted up in school on Friday he would not get to watch any TV all weekend. (Tv is a treat because he only gets to watch it about 30mins per day). He acted up on Friday and we followed through with our threat all weekend. Whenever he asked we explained why he could not watch. 
On Monday he had a great day at school and his teachers were very pleased. Then today I pick him up and find out he intentionally hit another kid in the head with a wooden tool set. The report said it was uninstigated. Again, I had a talk with him and he is not allowed to watch tv tonight. We are very consistent and try really hard to follow through with what we say. 
Is this a phase or are we doing something wrong?