Hmmm.... You say an inch wide by an inch deep, so assuming these are not through-holes. Those would be a little harder to patch, especially getting everything to 'stick'.
Also, you also say these holes were made by anchors - so is this more of a structural repair vs cosmetic?
At first glance, spray foam seems to be the best and would most closely match the original foam material. Of course if you only have a few small holes, once you start using the can, it would likely go bad over time. So might waste nearly a full can for a few small holes. it would also be messy and need several steps to clean-up and shape to final form. If you do go this route, you might try the 'low expanding' window/door type. It seems to be a bit more dense and would probably be more durable than the 'expanding' foam which seems to be more...well...foamy!
Couple other possibilities that come to mind... a paste of elmer's glue and saw dust, "Bondo" body filler, "monster mud" molding compound, drywall joint compound, play-dough. Possibly others, but I guess anything that has a pasty/sticky consistency that will 'set up' to some solid form.
One thing to be careful of - at 1 x 1 inch - if you use anything that needs to physically 'dry' vs 'chemically set', you might apply in a few thin layers with dry time between each - or the center could stay gooey for a long time - and possibly the whole mass could shrink and crack as it dries.