A friend once explained my son's goofball behavior to me this way:

Imagine putting an 8 yr old in a K class, all 5 yr old in there. The 8 yr old is either going to act bossy, or goofy, because that is the only way he/she can relate to those young'uns. Well, even though chronologically your child is one age, and maybe often even emotionally, mentally, they are just functioning at a different level, and so acts odd to be able to relate to those kids in class.

It is why my son turned into the class clown when he was litte. (We now homeschool, and sometimes he still clowns around, but we also have some interesting, and serious talks. Then he goes off and plays....)