Perhaps he's doing it to get your attention (and I bet it works!). Or maybe it's simply because he's been sitting in a dirty diaper too long. Or it might be because he likes playing with the squishy texture of the poop. And so on.
Depending on his reason for doing it, you might want to handle the situation somewhat differently. In any event, though, you'll probably want to think in terms of both short-term solutions to head off the behavior right away and long-term strategies to make it less likely to happen again.
In the short term, the key may be to stop the behavior before it starts. Be sure to change his diaper frequently. Use a baby monitor to listen for telltale sounds during nap time, so you can zip in for a quick change before he gets into mischief. You can also make it harder for him to get into his diaper by dressing him in one-piece pajamas and turning them inside-out so that the zipper pull is on the inside.
In the long run, you can also try to provide more socially acceptable outlets for squishy fun. Try stripping him down to his diaper(to avoid messy clothes) and sitting him in his high chair to play with a bowl of yogurt, pudding, or whipped cream. If that's a hit, then as he gets older, you can move up to playing with sand, clay, or a mixture of cornstarch and water. As you help him discover the "right" time and place for this sort of play, you may find that he doesn't really need the "wrong" sort anymore.