Yes, the water you used to soak the dates is probably the issue; most of the ingredients you listed are shelf-stable because they have extremely low water activity; the possible exception is the vanilla, which if it was in the form of vanilla extract or essence would have been shelf-stable because of its high alcohol content.
Adding water to the dates would have raised the water activity of the whole mixture to a level that may have then supported microbial life, such as the mold you eventually saw on the surface.
To make your spread more long-lasting, reduce the overall water content by not soaking your dates (and just powering through having to grind them up while they're still relatively hard) and possibly using a lower-moisture form of vanilla (like the seeds scraped directly from an actual vanilla pod, or vanillin sugar, or maybe vanilla paste)
Alternatively, you might keep your recipe the same and just only make enough at a time that you can use it in a couple of days, or keep most of a batch in the fridge and only have a small amount kept at room temperature at any given time, so that you go through it before the mold has time to grow.