The word gymnasium was used in ancient Greece, meaning a locality for the education of young men. Physical education was considered at least as important as learning, and the fact that the students were naked (gymnos in Greek) when performing bodily exercises explains the use of the word in the United Kingdom and the United States.
See also: Gymnasium (school)