The main purpose of the tree of the knowledge of good and evil didn't lie within the tree itself. There was nothing inherently magical, different or evil about it, as some depictions of the two trees suggest. It probably was very similar to or the same as the tree of life near or next to it (Gen 2:9, 3:3) - Don't forget, God said all the trees were good for food (Gen 1:12; 2:9, 16-17).
The primary purpose of the forbidden tree was to see whether Adam and Eve (and now we) would follow God's direction as instructed i.e. would they trust God and follow His directions or not.
The fear of the Lord is the beginning of wisdom i.e. true understanding of right from wrong. If Adam and Eve had listened to God's direction - i.e. had proper regard for God and respected His direction to not eat - they would have taken the first step onto the road of true understanding of right from wrong - good and evil - the right way i.e. by following God's direction or instructions and not try to gain this knowledge on their own i.e. by their independent (rebellious) efforts.
To gain the knowledge of good and evil the right way was by trusting what God said and acting accordingly. To believe that even if something looks wrong regarding a given direction or circumstance, we would still trust him.
The primary purpose of the forbidden tree was to see whether Adam and Eve (and now we) would follow God's direction as instructed i.e. would they trust God and follow His directions or not.
The fear of the Lord is the beginning of wisdom i.e. true understanding of right from wrong. If Adam and Eve had listened to God's direction - i.e. had proper regard for God and respected His direction to not eat - they would have taken the first step onto the road of true understanding of right from wrong - good and evil - the right way i.e. by following God's direction or instructions and not try to gain this knowledge on their own i.e. by their independent (rebellious) efforts.
To gain the knowledge of good and evil the right way was by trusting what God said and acting accordingly. To believe that even if something looks wrong regarding a given direction or circumstance, we would still trust him.
The purpose of the tree was to simply test whether they trusted God or not. It was a test of whether they recognized their total dependence on God for true life and wisdom or believed they could somehow find it and make life work better without him.
They choose to believe the lie that they could gain wisdom - and thereby life - without God. We continue to wrestle with and operate this way to this present day. They rebelled and rejected His direction and instructions. They did not trust God but turned away from Him. We do as well today.