It was a consequence to their disobedience. They were given perfection and felt no shame. After their sin of disobedience their eyes were open to their sin and the feeling of shame was opened to them as well as guilt, lust and a miriad of other things. They became "aware" of their nakedness...