The knowledge of good and evil is merely the awareness of what it means both in accepting God and being in His graces and rejecting God and being absent from him. This comes only by the experience of a fallen world. Satan knew that God created all beings (self-aware entities) to relate to Him, and being LOVE, He must be related to freely. God did not provide the option for people to reject Him because He wanted, out of Love, for all beings to be happy. But because Satan was the first being who fully rejected God, he was motivated to spread that infection among human beings who were created to enjoy the creation. But God also, being righteous and just, had to allow Satan to offer this option, because otherwise, He would not be Love.
It is as if you love someone and do all good things for them, and they know only your goodness and they seem to "love" you back (but really just like you). And your enemy comes and say, they only "love" you because you are generous to them. But let me offer them the option to reject you and the bitter consequences and see how they will curse your name and hate you in truth.
Being Love, you cannot deny that option, because love requires free will. So Satan thought he had God by the law, but God turns it around to defeat Satan with redemption. God himself comes down to man's level and bears the consequences of sin--THE act of supreme love.
So, the beautiful story!