Many sprays will eat foam. I believe it is the stuff used as propellant. I find silicone does foam better. You just need to give it plenty of time to dry if it is deep between two sheets where there is little air.
If you are building backgrounds and such, you can just use toothpicks or something to hold the foam together while you are working on it, and then the final coating (epoxy, silicone, great stuff, whatever) should hold the pieces together more permanently.
If you can, use 100% silicone. I've used the cheapo GE 100% silicone in three different aquariums, and haven't had any problems. If you call their number, they won't tell you it's aquarium safe (they probably have a more expensive product for that) but I haven't had any problems whatsoever, and the silicone has been in my tanks for a couple years now. You can get a caulk tube of it for five bucks at your local hardware store, but you'll need a caulking gun as well. Probably another 5-10 bucks.
As a matter of fact, yes, I always post, or reply, in novels. I'm adding it to my signature because it seems like I say it in every post!
Fraternity of dirt #32 I'm dirty UGLY TANK DIY Asian themed aquarium stand