It is a sin to disobey God. Adam, Eve, and the serpent were punished for disobeying God. The only moral principle that matters here is that God's word is absolute so it is actually irrelevant why God forbade Adam to eat from the Tree of Knowledge or whether Adam could know beforehand that doing so was wrong.
I'm really not a fan of this creation myth. it would be sooo much better if instead of Adam it was Ada and Eve and instead of a vengeful God it was a kind forgiving Goddess instead lol.