As I understand it, you can't do anything to prevent it except to not have any materials around that rot -- which basically means not having a garden, as I define it.
I leave it. I think it's kind of cool, actually. Gross-looking, but cool. It's a slime mold, not a fungus.
http://botit.botany.wisc.edu/toms_fungi/june99.html