Before bicycles existed. It goes back to Roman times. Most men involved in the "physical culture" movement of the late 1800's-early 1900's were trying to copy the greco-roman ideal. They shaved. Most men in mediterranian climes still shave, so cyclists shaved.