Panspermia?Some say they are extraterrestrial life, the spores traveled through space.
Don't think that happened though, fungi came around when life was well underway. Heck, the reason we can dig up coal now is because there was nothing that broke down ancient tree and plant material during the carboniferous period.