A hakama is the skirt-like pants that some Kendoka wear. It is a traditional piece of samurai clothing. The standard gi worn in Kendo as well as in other martial arts such as Aikido or Karate was originally underclothes. Wearing it is part of the tradition of (most schools of) Kendo.
The hakama were originally meant to protect a horseman's legs from brush, etc., -- not unlike a cowboy's leather 'chaps'. Leather was hard to come by in Japan, so heavy cloth was used instead. After the samurai as a class dismounted and became more like foot-soldiers, they persisted in wearing horseman's garb because it set them apart and made them easily identifiable.
There were different styles of hakama though. The type worn by today's martial artists - with "legs" - is called a joba hakama, (roughly, horseriding thing into which one steps). A hakama that was kind of like a tube skirt - no legs - another and the third was a very long version of the second. It was worn on visits to the Shogun or Emperor. The thing was about 12-15 feet long and was folded repeatedly and placed between the feet and posterior of the visitor. This necessitated their shikko ("knee walking") for their audience and made it extremely unlikely that they could hide a weapon (retainers suited them up) or rise quickly to make an attack.

   

The 7 folds in the hakama (5 in the front, 2 in the back) is said to have the following symbolic meaning:
Yuki = courage, valor, bravery
Jin = humanity, charity, benevolence
Gi = justice, righteousness, integrity
Rei = etiquette, courtesy, civility (also means bow/obeisance)
Makoto = sincerity, honesty, reality
Chugi = loyalty, fidelity, devotion
Meiyo = honor, credit, glory; also reputation, dignity, prestige