DO NOT PUNISH HIM FOR THIS! Children have issues with "accidents" through all ages. No age is deemed normal or appropriate because every child is different. If you believe there is something further going on like an Undiagnosed disease and your doctor doesn't want to do further testing then seek a second opinion.
I would like the fact to be known I am not a doctor but I do firmly believe punishing a child for this impairs social and physical Relationship as an adult. I studied childhood education and now teach elementary school.
Google encopresis and consider putting him on more fiber. In general, if he doesn't seem to be soiling himself on purpose and smearing poop, it's highly likely he can't control his bowels.
Is he having this problem while at school? or just at home? or both places? Does this tend to occur at any particular part of the day?
It sounds as if you are searching for a psychiatric diagnosis. I would shift gears and look for a medical diagnose instead. I encourage you to have your son evaluated by his MD to rule out any medical conditions that could be triggering this behavior.