I asked about the sudden feeling of being ashamed of being naked in Biblical Hermeneutics when asking about Genesis 2 and 3 - Why was nudity suddenly a shame for Adam [and Eve]?.
The following is the accepted answer and has biblical references which may help with your question.
1. Question Restatement:
In Genesis, why did Adam and Eve become ashamed when they realized they were naked after eating from the Tree of the Knowledge of Good and Evil?
2. Possible Answer - It is shameful for the one who knows good, but does not do it:
The Tree of Knowledge was Knowledge of BOTH Righteousness AND Evil:
NKJV, James 4:17 - Therefore, to him who knows to do good and does not do it, to him it is sin.
It was not revelation of some sin that they had done that made them ashamed.
But rather, it was knowing the "Good" that they had not clothed themselves in, that made them ashamed, (the "Good" imitation of the love and mercy of God - righteousness).
At the very least, even if the narrative isn't teaching to clothe oneself in "good work" or "righteousness", then it is at least affirming that clothing your body is a "Good" thing.
So, compared with the goodness of God - they were likely ashamed of how their own "goodness" measured up to God's own.
NKJV - Revelation 3:15-18 - “I know your works, that you are neither cold nor hot. ... 18 I counsel you to buy from Me gold refined in the fire, that you may be rich; and white garments, that you may be clothed, that the shame of your nakedness may not be revealed; and anoint your eyes with eye salve, that you may see.
3. Explanation: The Spiritual / Mystical Symbolism of Clothing:
Although Scripture might speak to "modesty", Scripture elsewhere affirms nudity - "before the Lord".
Scripture shows justification for more extreme, and public, displays of nudity:
NKJV, 1 Samuel 19:24 - And he also stripped off his clothes and prophesied before Samuel in like manner, and lay down naked all that day and all that night. Therefore they say, “Is Saul also among the prophets?”
NKJV, 2 Samuel 6:20-21 - ... And Michal the daughter of Saul came out to meet David, and said, “How glorious was the king ... uncovering himself ... as one of the base fellows shamelessly uncovers himself!” 21 So David said to Michal, “It was before the Lord ...
In Scripture, "Garments" Are Metaphorical for "Works", BOTH Righteousness AND Evil:
NKJV, Isaiah 59:6 - Their webs will not become garments, Nor will they cover themselves with their works; Their works are works of iniquity, And the act of violence is in their hands.
NASB, Isaiah 61:10 - I will greatly rejoice in the Lord, My soul shall be joyful in my God; For He has clothed me with the garments of salvation, He has covered me with the robe of righteousness, As a bridegroom decks himself with ornaments, And as a bride adorns herself with her jewels.
NKJV, Daniel 7:9 - “I watched till thrones were put in place, And the Ancient of Days was seated; His garment was white as snow, And the hair of His head was like pure wool. His throne was a fiery flame, Its wheels a burning fire;
People are NOT "spiritually naked" - when they do evil:
Note: This is an objection to another answer that asserts that nakedness is a metaphor for sinfulness - but even "sinful people" are "clothed".
NKJV, Zechariah 3:4 - Then He answered and spoke to those who stood before Him, saying, “Take away the filthy garments from him.” And to him He said, “See, I have removed your iniquity from you, and I will clothe you with rich robes.”
Adam and Eve, (like infants), were in a unique situation: they were neither clothed in goodness, nor evil. Although they had disobeyed God, this text seems to show that their disobedience was not on the same level of "evil / filthy garments".