Krishna stole the garment from the unmarried gopis (cow maids) of Vrndavan who prayed to goddess Durga to have Him as their husband. While they went bathing in the river Yamuna, they left their clothes on the river bank and Krishna appeared in the tree above them.
Since it is only before her husband that a woman can be naked Krishna fulfilled their wishes.
‘He stole their clothes and hid with them in a tree. Despite their earlier pleas the cowgirls were mortified at the situation and tried to hide their nakedness beneath the water; but Krishna told them that Varuna inhabited the water so they were no better off in it. He instated that each of the cowgirls come forward to the tree to receive back her clothes.’’ Veronica Ions, Indian Mythology, (England, 1968) p.66-67
Krishna told them: “My dear girls, please come here one after another and pray for your garments and then take them away. I’m not joking with you, just telling the plain truth. Please don’t come here all at once. Come alone one by one; I want to see each of you in your complete beauty, for you all have thin waists.”
“The real meaning of story about Krishna taking away the clothes of the Gopikas while they were bathing is that to realise the Lord, they have to abandon the attachment to the body, which is the vesture of the spirit. These stories should not be treated in a spirit of levity or profanity.” Sai Baba, Summer Showers, 10/96, p. 257
A miniature painting of the same subject is in the collection of the National Museum, New Delhi, Chira Haran, late 18th century. Illustrated in Dr AlkaPande, Masterpieces of Indian Art, (India, 2007), p.41