Note that although this answer is based off my knowledge of the Napoleonic era, the same should apply to the 17th and 18th centuries as well.
Why wouldn't they? With the limited range of muskets (about 80m) they would have no need to run until they were close, and even then they would stand in line and trade fire.
Running would only be used when there was a point that needed taken rapidly (such as in a siege) or in a bayonet charge, when they would want to close before the enemy had a chance to fire a close range volley.
The only thing that could kill from a reasonable distance was artillery, but to run the distance to the artillery would be exhausting, and seeing as the most important measure for infantry was how fast they could reload and fire (on a good day some units could reach 5 a minute, but most could only manage 3) they would most likely lose against any well-rested enemy.
As /u/ErikMcAwful said, keeping a disciplined formation was a concern, and any spread out infantry would be very vulnerable to cavalry, as infantry relied on their tight formation to fend off cavalry with the bayonet.
The effective range of muskets was something like 100 meters. The rate of fire was so slow that it did not matter if men walked or run to close the distance after that. A walking unit could keep their lines cohesive.
However, this theory did not hold. The Swedish army in early 18th century changed their regulations so that the attacking unit would fire a volley at distance, advance running, fire a volley at 20 meters and then charge the enemy.