Pecan is a type of nut. A pecan pie is a type of pie. "Pecan" kind of sounds like "pecking". When a human being is "pecking" at something, it means they're nibbling on something. This joke is playing on the "pecan" because it sounds similar to "pecking" and how it refer to eating pie. 
He wasn ' t supposed to eat the pie but he kept pecan at it .