Earlier those who were visiting the Kaba were not allowed to wear their own clothes. They had to brrow the same from the local residents or if they wore their own, those clothes were to be donated to the locals. Most of the piligrims therefore visited Kaba in complete nudity. There are many customs like this in any community. Finding an answer to the same in 21st century is a futile exercise.