At the beginning of Chapter IV Spinoza introduces the word Predestination and says he will speak of it later. Here he says that since God is perfect that which he makes cannot be more perfect than it is and he could not have omitted that which he has done since to omit something would be an imperfection.
He says Now, we maintain that, since all that happens is done by God, it must therefore necessarily be predetermined by him, otherwise he would be mutable, which would be a great imperfection in him. And as this predetermination by him must be from eternity, in which eternity there is no before or after, it follows irresistibly that God could never have predetermined things in any other way than that in which they are determined now.
In a created thing it is a perfection to exist and to have been produced by God, for, of all imperfection, non-existence is the greatest imperfection ; and since God desires the welfare and perfection of all things, it would follow that if God desired that a certain thing should not exist, then the welfare and perfection of this thing must be supposed to consist in its non- existence, which is self-contradictory. That is why we deny that God can omit to do what he does.
In the Ethics Spinoza denies that (Deus sive Natura) has emotions yet here he says that God desires the welfare and perfection of all things. It would seem that between the two works his idea of God has vastly changed.