One possibility may be honey.
As other answers mentioned, sugar substitutes or artificial sweeteners that do not act like sugar, chemically, won't have the same effect of substituted into a recipe. They won't sweeten the same way, tie up water the same way, and will not preserve the same way - though some may have other preservative effects, as rackandboneman's answer suggests.
But, if the restriction is not about artificial sweeteners but simply not using refined sugar - then natural sweeteners like honey may fit the bill. Honey is like sugar, hygroscopic, in that it tends to not go bad because there isn't enough water available for spoilage - and it also has mild antimicrobial properties, to help prevent spoilage another way. As for the bonus, it will not alter the taste of a recipe very much, compared to using white sugar - especially if a mild, clear honey is used. The flavor alterations should be subtle and might even be beneficial.
Other natural sweeteners like maple syrup, agave nectar, jaggery, or even molasses, corn syrup, or others - may also act like sugar both for sweetening and as a hygroscopic agent. They may add more noticeable flavors, though, and may be be less of a straight substitute for a preservative then sugar or honey due to higher water content, inclusion of impurities, or more requirements for safe storage.