Moldy notes are usually due to moldy soft plastic or rubber bits, like airlocks, hoses or fermentation buckets being left in contact with moldy surfaces, or being used for brewing after being put away wet so that mold grows on/in them. Mold aromas and flavors are very pungent and can easily penetrate plastic and rubber.
So, if your fermenter had mold in it (e.g., standing water) or if you were fermenting in a plastic bucket which was allowed to sit on a damp floor for a long period of time, your beer could have picked up a moldy smell even if there was no actual mold in your beer. Since mold is aerobic, actual mold in your fermenter would have formed fuzzy or slimy colonies on the surface of your beer after fermentation settled down. Given that your beer was only fermenting for 2 weeks, though, unless you're in a high mold environment (e.g., places where it's warm and wet) it seems a bit unlikely.
I wouldn't worry too much about the gap in the airlock, especially if it occurred early in fermentation when there was still a fair of CO2 being produced. The "overpressure" of the gas pushing out of fermenter would have kept any bad bugs from getting into your beer.
My guess is that the mold notes came from the the spruce or the honey. Either the ingredients were actually moldy (unlikely) or you're just interpreting some aspect of the spruce/pine/honey aroma as being moldy.
It's also possible that you're interpreting some yeast-related compound (e.g., a phenol) as mold. Yeasts can sometimes produce smoky notes that can get interpreted as "peaty" or "earthy."
My advice is to not worry. Bottle the beer, let it condition for a couple of weeks and taste it again to determine if the moldy aroma is still there.