What else can contribute to toenail fungus? Not keeping your feet sufficiently clean and dry. "Toenail fungus absolutely loves warm, moist environments like sweaty shoes and socks," Dr. Ali says.