You might be able to salvage your spices. Put them in baggies (labeled) and stick them in the freezer. Then thoroughly wash the spice container. After a few days in the fridge, put the spices back in their jars.
Snapseal cannisters work well to keep out bugs in the pantry (I switched after losing a huge amount of cornmeal and flour kept in Rubbermaid cannisters.) I live in the deep South and all my flours, cornmeals, etc are stored in the freezer except the "in use" portion in my cannisters. It also makes your freezer run more efficiently if it's really full, so I kill two birds with one stone!