Spinoza’s Ethics was published in 1677. Not always an easy text for modern minds. This is one of my favorites passages (from the Appendix to Part 1):
“Every individual devised different methods of worshipping God as he thought fit in order that God should love him beyond others and direct the whole of Nature so as to serve his blind cupidity and insatiable greed. Thus it was that this misconception developed into superstition and became deep-rooted in the minds of men, and it was for this reason that every man strove most earnestly to understand and to explain the final causes(*) of all things. But in seeking to show that Nature does nothing in vain – that is, nothing that is not to man’s advantage – they seem to have show only this, that Nature and the gods are as crazy as mankind.
Consider, I pray, what has been the upshot. Among so many of Nature’s blessings they were bound to discover quite a number of disasters, such as storms, earthquakes, diseases and so forth, and they maintained that these occurred because the gods were angry at the wrongs done to them by men, or the faults committed in the course of their worship. And although daily experience cried out against this and showed by any number of examples that blessings and disasters befall the godly and the ungodly alike without discrimination, they did not on that account abandon their ingrained prejudice. For they found it easier to regard this fact as one among other mysteries they could not understand and thus maintain their innate condition of ignorance rather than to demolish in its entirety the theory they had constructed and devise a new one. Hence they made it axiomatic that the judgement of the gods is far beyond man’s understanding. Indeed, it is for this reason, and this reason only, that truth might have evaded mankind forever had not Mathematics, which is concerned not with ends but only with the essences and properties of figures, revealed to men a different standard of truth.”(Spinoza, Complete Works, Edited by Michael Morgan, pages 239-240.)
Spinoza definitely did NOT believe that “everything happens for a reason” as one hears quoted so often today in pop culture. Mathematics is not concerned with ends and thus presents a different standard of truth.
(*) By ‘final cause’ he means the purpose. This is Aristotle’s final cause.