Presumably people in Okinawa didn't walk around barefoot. If the original purpose of karate is self-defense, wouldn't it make more sense to train in similar clothing to what you'd be wearing if you were attacked?
In Japanese styles, it is unquestionably about cleanliness. They don't wear outside shoes in one's home, and zori are used for that purpose. But zori make it somewhat difficult to train in, and as well, expensive tatami mats do not wear well with shoes worn. So, they train barefoot. I've seen many a Japanese instructor painstakingly give the hairy eyeball to a repairman walking over the tatami mat with his boots on to fix the plumbing, a ceiling leak, or some electrical thing; and when the ordeal was over, have students wash down the mat whereupon the miserable heathen stepped.
In Korean styles, there's several answers. One answer is that they don't train barefoot - they wear light sneakers built for the purpose of training. However, with many taekwondo schools, they do lots of jump and spin kicks, and so, a mat is needed to protect the students from hard landings; these mats do not wear well when shoes are worn. As a result, instructors are usually the ones who wear the training sneakers - not the students. However, those training sneakers are made so as not to be so "grabby" to the mats, and occasionally, you find students training in them. But most mats are made for the human foot - not shoes - and so, the grabbiness of a mat is reduced when barefoot compared to shoes.
In other Korean styles, such as Yudo and Kendo, and derivatives, their customs come directly from their Japanese style counterparts - Judo and Kendo, respectively, and so, they're barefoot. It seems curious to me that Kendo/Kumdo students do not wear shoes, despite that they rarely ever lift the foot off the floor, and, they usually compete on bare wood flooring - perfect for shoes.
In styles where head kicks are allowed, no one wants to get a face full of shoe (not that a sweaty sole is any better). But there is a safety and/or a comfort issue.
I can also say this, having competed in many a tournament hosted in a high school gymnasium. Such places are ripe for dust balls, dirt, parking lot pebbles, and the occasional spilled orange soda and dropped hot dog - none of which is comfortable to step in. Trying to compete on such a gymnasium floor is very difficult - the dust can create a slippery surface; conversely, a well-managed floor which has just been lacquered can be very grabby on the foot. Training shoes can meet the middle ground. Also, I've competed in hotels. They have carpets, but you never know if the wedding party the night before had a mishap whereupon someone broke a champagne glass. I always make it a practice to wear training shoes on hotel flooring for just this reason. As a result, for me and may like me, training for a tournament on a gym floor or a hotel means wearing shoes, so for tournament season, always train with shoes in the dojang.
Keep in mind that we train for what we expect to encounter. If we are training for sport, then we have different expectations than for practicing for self-defense. In practicing for self-defense, I think it unconscionable not to practice with street shoes at least once in a while - noting the wear and tear on a training mat, there can always be occasional practice on a grass, beach, or asphalt surface.
Whilst I cannot answer the origins, there are many reasons why I still instruct barefoot to a barefoot class.
- Safety - when we involve blocks of kicks - any design in the shoes worn, hard plastics or metal especially, could damage the blocker in an inconsistent way (making it harder for the blocker to build confidence)
- Grip is consistent - whilst shoes could be soled with any material - the sole of my foot is the same material as all my students - this means the floor is slippery to everyone or no-one
- Weight - swinging your foot around - especially high from the ground - requires strength and flexibility, add the weight of a shoe and you increase the likelihood of loss of control. I have seen many people tear muscles whilst warming up wearing ankle weights or similar.
- Fashion - not seriously - but part of martial arts is looking and acting as a group - we all wear the same outfit as we don our 'soldier' mentality. Shoes would be an individual distraction unless they became part of the attire (like sparring kit sort of has).
I suspect many of the safety aspects from above are why barefoot training is so wide spread in the MA community.
In response to training in attire similar to when you would need to defend yourself - this is also difficult - it is probably most likely we get attacked at night, in an unlit area, in the rain, on gravel. It would be practically impossible to teach a class in those conditions - we make it safe before we make it real.
This answer does not directly address the karate aspect, but I think it is still relevant, as Collett89 has pointed out in his comment.
The development of your feet and legs depends upon the environment you put them in. Training barefoot forces you to use your feet to a greater degree than when in shoes. For some people and their shoes, this is a much greater degree.
This excerpt is from Higher Judo: Ground Work by Moshe Feldenkrais published by Frederick Warne & Co., Ltd. London, 1952, p18. Feldenkrais trained with Jigaro Kano, the founder of judo.
First of all Judo is practised with bare feet. Many people have never made any but the most primitive use of their feet, with the result that the only use and idea associated with them, is that of a plate-like support to the body. This being the only use made of the feet for many years on end, the muscles are most of the time maintained in a fixed state of contraction-precisely the one that makes the feet fit for the service demanded of them. In extreme cases the exclusion of other patterns is so complete, that the feet become frozen in the flat, plate-like position and are almost useless for any other purpose than motionless standing. When required to change shape, that is, to alter the pattern of contraction of the different muscles and consequently the relative configuration of the numerous bones of the feet, some muscles are too weak and do not contract powerfully enough, other muscles and ligaments are too short and their stretching to the unaccustomed length is painful. Such persons are forced to assume queer positions of the legs, pelvis and the rest of the body to make movement possible while maintaining the feet in the accustomed way. They tire more quickly than other people, become irritable, their movements lack swing and ease and they are peculiar in many other ways.
I have personally met people who use their feet as "plate-like support to the body". I find this description still apt today.
Some kicking styles do use shoes: in Savate, shoes are worn in training and sparing.
In Japanese culture, wearing shoes indoor is considered impolite and dirty. Thus, shoes are taken off at the front door. All dojo are indoor buildings thus I can safely assume that shoes would not be worn there. An array of socks and indoor slippers do exists but they are not terribly practical for physical activities. They do not drain sweat very well becoming slippery and dangerous.
While I like the primary sources to say this is the reasons most Japanese martial arts train bare foot, it is a possible explanation.
In addition, dogi are under vestments worn as "exercise cloths". We rarely, if ever, train in street cloths. Maybe we should but generally sport wear is just more practical.