You are misunderstanding the "knowledge of good and evil". Many people take it to mean being able to discern between the two. That's not quite it. God is good. Scripture declares it so. And, Adam knew God. So, Adam HAD the knowledge of good. What he didn't know was evil, which is to follow Satan's lie rather than God's instructions. The verb "to know" throughout Scripture carries a lot more weight than we in modern times give it. It was rarely meant to be understood as a simple mental assent of fact. Instead, it denoted an intimate and thorough understanding of. A bond. Which is why the relationship between Adam and his wife, Eve, was referred to as "Adam knew his wife". Adam had full fellowship with God before he sinned. And God will tolerate nobody else taking His place in our heart. He doesn't share us with anyone. Either He alone is supreme in our heart, or He is not. When Adam consented to what Satan said, he was rejecting what God had told him and accepting Satan's word as truth, instead of God's. In so doing, he became intimate in his knowledge of Satan. So, the result was that Adam was intimate with God AND Satan. That is idolatry. So, the operative word in the phrase the "knowledge of good and evil" is not "knowledge. The operative word is "and".