Original: Inspired by the Cincinnati Red Stockings, the stocking colors of teams in the 1860s onward were a principal device in distinguishing one team from another (hence team names such as Chicago White Stockings, St. Louis Brown Stockings (or Browns), etc.).
Simplified: Teams started to be called the Chicago White Stockings or the St. Louis Brown Stockings because of what colored stockings they wore at the time.