I've done a number of these 'fills' over the years, try to avoid them, though I don't think it will accelerate decay. If anything it will help if it just keeps water out of the cavity. I would always spray for bugs before shooting the expanding foam (which is the reason I try to avoid this service- I don't do chemicals well)
The last time I did one, the dispenser tube was defective. I kept bending the nozzle, working it over different ways and when that sucker snapped, the entire contents of the can came out in 0.2 seconds. I mean, the entire can. It was not pretty. The can was not facing into the cavity. Valuable tip..... don't get this stuff in your hair.
I've only done a couple dissections through a foam-filled cavity and both times there was no evidence of insects within, and CODIT walls were intact and well. Two times is not a big pool of experience to draw from, but even though I didn't get the pics, I did crosscut those zones (both of them) at 2" (5 cm) intervals like a tree pathologist might do, looking, and learning. I saw only positive results when looking at this stuff from the inside. I have no idea how long the foam had been there.
The surface is prone to decomposition by ultraviolet. I think painting would help this, as well as make it a better-looking job.
p.s. Welcome to the site, Rocko!