A lot of mental illnesses first emerge during puberty. It seems pretty likely that that's what happened here, combined with a young child's inability to understand the gravity and permanence of death.
In any event, a person's life should not be defined by what they did at age 11. I really hope that he gets a sympathetic judge.