I'm going to offer this as a possibility, one that has some support in current science but that I find philosophically unpalatable enough that I'm not sold on it's truth:
Free will is an illusion, and we post-hoc narrate reasons for our actions.
So when your child answers he is answering honestly that he doesn't know because he isn't yet far enough along in his development to fabricate the kind of internal narrative an adult would.
In other words, none of us know and your son is just being more honest with himself (and you) than the rest of us.
That being said, I recommend that you encourage your son to stop and think before performing actions. Also regardless of the above argument for determinism, I disagree that a 7 year old is rationally calculating "oh if I do this I'll be punished, but it will be worth it": that's adults projecting their adult thinking on to a child.
References
In addition to the Scientific American article linked above: