Dojo is made up of two characters, 道場. The first character, Do, translates as "The Way" and holds a spiritual connotation. "The Way" specifically refers to the path to enlightenment. The second character, Jo, means "place." So a dojo is literally a "place to practice the Way." It is a hall to study the path to enlightenment, a place of spiritual cultivation and an institution of higher learning. The word dojo is not confined to martial arts training, and can be extended to any of the -do forms of Japanese arts, such as shodo (calligraphy). In fact, it is even used in Zen Buddhism to describe the meditation halls where they practice zazen.
In actuality, what most people consider to be a dojo is really a keikojo 稽古場. Keiko literally means "practice," and refers to physical training. Keikojo is the most appropriate term for a martial arts school that does not engage in any spiritual development, that is purely focused on physical training without the trappings or rituals of a traditional art (what some may call a "gym" or "club").
So now that we've defined what the terms dojo and keikojo are, let's go a little more in depth.