Amazon.com Inc.’s contest to find a place for its second headquarters is spurring civic leaders around the country to confront municipal problems that have confounded lawmakers and local leaders for decades.

Suddenly, some cities and states are highlighting plans such as easing traffic, adding housing and investing in higher education.

Among...