It is common in modern thought to regard shame as a purely negative emotion, but, the concept of shame, as used scripturally, is, like many emotional concepts is the scriptures, connected to action. It is my understanding of shame, that it connects to the action of hiding. Adam and Eve were ashamed and sewed fig leaves to cover their nakedness. They also hid from the Lord. It is easy, as an English speaker, to look at the immediate results of this shame and judge it as unhealthy because they reacted in an unhealthy way. However, what was the Lord's response and counsel to Adam and Eve? Was it not to offer his own superior covering to hide their nakedness? In addition, he has offered his son that we might repent and be forgiven. In Jewish thought, this is described as "covering" our sins. The Hebrew word translated as "atonement" is closely related to the Hebrew word for forgiveness, which also has the meaning of "reconciliation" and "covering".
In other words, the emotion associated with shame can lead either to hiding from God, or seeking refuge with God. It is not the feeling that is wrong, but the way in which we seek to address it.