All my children tried this when they were in kindergarten or first grade. One of my girls whisked some bubble gum balls out of an open container sitting right within her five-year-old arm's reach. She did it so quickly that I didn't even realize what she had done until I saw there was something (actually, several somethings) in her mouth. She removed the items from their location, and then she and I went to have a talk with the checkout clerk, who was gracious enough to understand the lesson that needed to be learned and accepted my daughter's dime - which was what she had in her pocket - instead of letting her off.
Children don't know automatically that they can't have what they want and that's sitting there so temptingly. If it's in reach, they sometimes think, "It must be all right *this* time, maybe."
To know that Mama and Daddy (and Teacher and Principal) say the item belongs to somebody else - even to the store - is good for them to hear when they don't *quite* know well enough themselves. You didn't condemn your son as a hardened criminal, but you didn't shrug his action off. Hopefully, you made it clear that actions have consequences. Our faith gives our family definite guidelines on how to treat other people's property. Perhaps yours does, too - I don't know.
You can back this up over time in a friendly but teaching way. "Yes, those *are* nice candies (magnets/crayons/whatever), aren't they? They belong to (fill in the blank), you know. If I wanted some candy like that I would need to pay money for it at the store so that it would belong to me. But it's almost time for dinner, anyhow, and not candy time, so we'll just enjoy looking at it."
It takes a while to get this ownership/integrity/honesty business down really solidly in a little mind. This is a good start. I'm imagining that the after-school program cancellation is a consequence of the fact that you can't quite trust him today. But tomorrow he can do better, and you'll be cheering him on. And that's that.