WASHINGTON—Declining business investment is hobbling an already sluggish U.S. expansion, raising concerns about the economy’s durability as the presidential campaign heads into its final stretch.

Gross domestic product, the broadest measure of goods and services produced across the U.S., grew at a seasonally and inflation adjusted annual rate of just 1.2% in the second quarter, the Commerce Department said Friday, well below the pace economists expected.