Spontaneity has a technical meaning in Kant and Husserl that is at odds with common usage. In ordinary speech, we are said to do something “spontaneously” when we do it on the spur of the moment, without a previous plan. But Kant and Husserl call everything guided by reason “spontaneous”, even though reason is involved with conscious deliberation and thinking things through.
According to an older usage, things in nature were said by some to occur “spontaneously” when they had no discernible cause. In the scholastic tradition, others argued that “nothing comes from nothing”, and rejected the assumption that things with no discernible cause really happen without a cause, as was purported to occur in what was called “spontaneous generation”.
Leibniz embraced and codified the “nothing from nothing” argument as the principle of sufficient reason. The principle of sufficient reason does not itself imply the kind of particular providence associated with the popular expression “everything happens for a reason”. It just says that everything has some kind of reasonable explanation, not that what we subjectively perceive as cosmic injustice is part of a divine plan, even though Leibniz separately argued for that as well.
Of course, it matters a lot what kinds of causes or reasonable explanations we recognize. In Leibniz’s time, the notion of cause had already been greatly contracted by early modern writers, who further transformed the late scholastic notion of efficient cause in a mechanistic direction, while accentuating the late scholastic tendency to reduce all other causes to efficient causes. Leibniz himself recommended the use of only mechanistic explanations in natural science, but did not see natural science as all-encompassing, and defended the use of teleological explanation in broader philosophy. He compensated for the narrowness of mechanistic causality by speaking of sufficient reason rather than sufficient cause, and kept a place for form and ends as reasons.
Kant ultimately also defended a kind of teleology, especially in biology and in his account of beauty, but he was much more reserved about using it in general explanation than Leibniz, due to his scruples about grounding all “theoretical” explanation in experience. However, he assigned all ethical matters to a separate “practical” domain, which he wanted to exempt from the kind of narrow causal explanation that he considered the norm for physics, and he argued that for us humans, “practical” reason is more fundamental.
Human action for Kant belongs to the practical domain, which he famously argued is governed by “spontaneity” and “freedom”. I now think “spontaneous” and “free” for Kant simply mean not subject to mechanistic explanation. Thus insofar as we are positively motivated by moral imperatives or values, he would say we act spontaneously and freely. I think he also believed that all human thinking is ultimately motivated by ultimate ends, and therefore called it spontaneous and free.
Kant confused generations of scholars by borrowing voluntaristic rhetoric, which he did with the aim of emphasizing that human thought and action are not reducible to mechanistic physics. But freedom and spontaneity in Kant do not mean arbitrariness, as they effectively do for defenders of voluntarism. Rather, they are meant to allow room for positive motivation by moral imperatives or values.
Another confusing move Kant made was to argue for a special “causality of freedom” that he never explained adequately. Due to its contrast with physical causality, it sounded at times like a kind of supernatural break in the natural order he otherwise recognized. Many commentators thought Kant contradicted himself in arguing both that the natural order is self-contained and that there is a separate causality of freedom. I think these problems are ultimately explained by the narrowness of the mechanical concept of causality in nature. The “causality of freedom”, I want to say, simply means motivation by moral imperatives or values rather than by impulse. Kant considered impulse to be within the realm of natural-scientific causality, and therefore opposed it to spontaneity, whereas contemporary common usage associates “spontaneity” with acting on impulse.
(Aristotle, with his much broader notion of cause that essentially identifies causes with any kinds of “reasons why”, would treat values and moral imperatives as one kind of final causes, or what I have been calling “ends”.)
Husserl’s way of speaking about these matters is to contrast human motivation with causality. For him, “causality” is exclusively the causality of modern physical science, but human thought and action are to be explained by “motivation” rather than causality. Husserl’s use of “spontaneity” is related to that of Kant, and applies to everything that he explains in terms of motivation. (See also Kantian Freedom; Kantian Will; Allison on Kant on Freedom; Freedom Through Deliberation?.)