A character of nationalism is to conquer and expand empire to include land seen as part of the national heritage. The Alsace-Lorraine region had been disputed land between Germany and France. The area had moved back forth many times cause war between the two nations. France wanting to regain the area was an attempt to reintegrate French people under the French flag.
In the West, the completion of the transcontinental railroad greatly benefited the "farming industry," since this meant that farmers could sell their goods to relatively remote locations, which greatly expanded their potential market and increased revenue.