According to his theory there is only one substance and that is God/Nature. But if God is only good can there be any evil or bad behavior etc.?
Spinoza views everything as modes of attributes of God,and God is eternal and infinitely good. So for him evil does not exist, he said that people view things as evil when they take things independently, but things should not be taken independently because everything; is an extension of God, thus everything is God and God is everything PANTHEISM. This is because our knowledge is limited. Evil exists only for humans, God has no idea of evil because He sees everything in connection to himself.
▻ GOD, NATURE AND EVIL
It is not possible within Spinoza's system for God or Nature to be evil or the cause of evil. To think otherwise is falsely to anthropomorphise God and Nature. Joel I. Friedman makes this helpfully clear :
Throughout Spinoza's system, a great deal of theological language is used, but in spite of this, it should be emphasized that God, the maximal substance, is not a person, but Nature itself. God is Nature. Consequently, God acts according to the laws of Nature, which are identical with the laws of his nature or essence. Moreover, God's mind is nothing like a human mind. Spinoza was against any anthropomorphic conception of God. Indeed, he devotes most of the Appendix to Part I attacking anthropomorphism. In brief, he holds that we should not project onto Nature or God such human qualities as "good and evil, merit and sin, praise and blame, order and disorder, beauty and deformity, and so forth". Of course, Spinoza is open to the charge of atheism, or mysticism, but in my view, these are all rather loose charges. My own view is that Spinoza blurred the borderline between atheism and theism and that he rationalized mysticism, both magnificent achievements. (Joel I. Friedman, 'An Overview of Spinoza's "Ethics"', Synthese, Vol. 37, No. 1, Spinoza in Modern Dress (Jan., 1978), 79.)
See further Ethics, I, Proposition 17, Scholium : Spinoza, Ethics, tr. G.H.R. Parkinson, Spinoza : Ethics, Oxford : OUP, 2000, 91-3.
▻ FREEDOM AND EVIL
'If men were born free, they would form no conception of good and bad [evil] as long as they were free' : Si homines liberi nascerentur, nullum boni, et mali formarent conceptum, quamdiu liberi essent. Reference below.
In my view, one of the most profound propositions in all the Ethics is the following: "if men were born free, they would form no conception of good and evil so long as they were free" [Ethics, IV, Proposition 68; Parkinson, 276]. In other words, freedom is beyond good and evil, to use Nietzsche's phrase. ... Yet ... a free man is still a social animal [E IV, Proposition, 73], if not a morally preoccupied animal. For, though a free man's actions may flow from his nature, they best do so when they flow in harmony with other men's actions, according to the guidance of reason. Thus, though Spinoza's free man is beyond good and evil, he is nevertheless a naturally ethical creature. ((Joel I. Friedman, 'An Overview of Spinoza's "Ethics"', Synthese, Vol. 37, No. 1, Spinoza in Modern Dress (Jan., 1978), 97.)
The basic idea is that if all our actions were determined by our own natures, and to no extent by external causes, then in this sense we would be free. Nothing could conflict with or thwart our wants and preferences, or desires and aversions. In a harmonious world in which all were free in this sense there would be no hindrances or frustrations in experience to generate the contrasting ideas of good and evil.
Freedom requires more than that all our actions are determined by our natures. There is an inescapable role for rationality. This will be explored in the next section.
▻ REASON AND EVIL
We are not born free. We do have ideas of good and evil. Thus Spinoza can say : 'A free man never acts deceitfully, but always in good faith' : Homo liber nunquam dolo malo, sed semper cum fide agit. (Ethics, IV, Proposition 72; Parkinson, 279.) What supports this statement ?
If we have adequate ideas, ideas of which our own natures or essences are the complete cause, then it is clear to the intellect, or reason, what is in our interest. What will then be clear is that 'if men are led by a clear-sighted view of their own interest, they will naturally tend to live on peaceful terms with one another, and to help each other' (R.J. Delahunty, Spinoza, London : Routledge, 1985, 271.
This makes sense but it is hard to extract from Spinoza ! The closest Spinoza seems to come to such an argument is at Ethics, IV, Proposition 35, Corollary 2 :
Men are most useful to one another when each man looks most for what is useful to himself. For the more each person looks for what is useful to himself and to preserve himself, the more he is endowed with virtue' (Parkinson, 250).
Virtue includes never acting deceitfully but always in good faith. Since most people do not have adequate but inadequate ideas, they will not have a clear-sighted view of their own interest, they will naturally tend not to live on peaceful terms with one another, and not to help each other. They will not be 'endowed with virtue'. Hence evil actions and states of mind, i.e. actions and states of mind conceived as evil and as contrary to virtue, will occur.
▻ THE RELATIVITY OF EVIL TO HUMAN KNOWLEDGE
Finally we should add or emphasise a point which H.H. Joachim brought out well :
To perfect knowledge, or in reality, there is no 'good' or 'bad,'[evil] no 'perfection' or 'imperfection.' Everything is what it is as a necessary consequence of the 'order of the universe' or the 'laws of nature.' But human knowledge knows only in part, sees things only from certain points of view and not in their unbroken and necessary coherence. And for that knowledge, 'good' and 'bad,', 'perfect and imperfect,' express adaptation or non-adaptation to purpose. Since the purpose is not in the things, but in our view of them; and since our views are only partial and therefore many, 'good 'bad',' 'perfect' 'imperfect,' are relative terms : and relative to such an extent that the same thing may rightly be called both 'good' and bad,', both 'perfect' and 'imperfect,' in accordance with our varying points of view. (H.H. Joachim, A Study of the Ethics of Spinoza, Oxford : OUP, 1901, 3.)
G.H.R. Parkinson, Spinoza : Ethics, Oxford : OUP, 2000.
Joel I. Friedman, 'An Overview of Spinoza's "Ethics"', Synthese, Vol. 37, No. 1, Spinoza in Modern Dress (Jan., 1978), pp. 67-106.
R.J. Delahunty, Spinoza, London : Routledge, 1985.