Why do you act like he did something wrong when he does something right.
When you do that he begins to associate intelligent behavior with punishment, so, in a way, you're actually training him to be stupid.
It's called operant conditioning, look it up