Now, God's sovereignty and man's responsibility is another discussion, but yes, for man to develop and not be a mere robot man had to know good and evil.
The Bible makes it clear that this gift comes of necessity fraught with severe circumstances.