They are made in Gods image and likeness.
Knowing right from wrong,good,evil, are cognizant abilities that permit an informed choice.
Which is what God expected of them when giving them the law against eating of that one tree. They had to know consequence first so to understand wilful...