Spreading your seed
For sessile life forms (plants, clams, etc), explosions could be an excellent method of seed/egg dispersion. Heck the organism could create a "mortar tube" and vastly improve the dispersion range of its young. Probably any woody or shell based tube would need to be a pretty low pressure affair, but it'd be an interesting way to spread one's seed.
Self Defense (As mentioned in other answers)
Over time this method of seed dispersion might evolve as a form of self-defense too. If attacked or nibbled on, it'd attempt to point its mortar tube toward the aggressor and fire it even if the eggs/seed weren't ready. Better to survive for another spawn then to lose the spawn and yourself.
Also, depending upon the specifics of the configuration, the explosion need not kill the "exploding" organism. If the organism was protected from the worst of the explosion (ala the mortar tube described above), the organism might develop the means of rearming and reseeding the tube.
If the mechanism did evolve from seed dispersal to self-defense (which is a logic progression IMO), it would lead to an evolutionary arms race in which the nibbler would learn to only eat certain portions of the sessile creature which wouldn't trigger the self-defense mechanism. Alternatively, they would wait until after seed dispersal to eat the organism once it disarms itself.
It would also evolves to "reload" the tube with new explosives pretty quickly after use and slowly lay the seeds/eggs in the tube for dispersal later.
Organisms in our own "Real Life" biosphere use explosions. One such creature is the Bombardier Beetle. It uses a hydrogen peroxide + some other organic compounds to form a steam explosion.
This sort of reaction would work great for the mortar tube configuration mentioned above and a similar trigger system would work too. Basically store the liquid hydrogen peroxide in a gland with a one-way valve. When excited the organism squirts some hydrogen peroxide into the mortar tube - which already has the fuel and catalyst in it. The explosion shuts the valve to the peroxide gland and forces the projectiles down the tube.
The Bombardier Beetle stores enough for approximately 20 shots. The explosion alone (with no projectile) often kills the attacking critter. Our exploding critter might do even better if it could launch projectiles. Just remember though, our critter would probably not be able to reload the projectiles so quickly. So the first shot would include projectiles while subsequent shots would just be the Exploding noxious gas.