This is Spinoza's famous rejection of Aristotelian teleology, which was the last seventeenth century nail in the coffin of the great man. Spinoza substitutes God, but loss of faith in that concept then left us with no purpose at all, as in Hume.