BEIJING—Standard & Poor’s became the last of the three major rating agencies to lower its view on China’s creditworthiness, a move that came as China has taken forceful measures to tamp down risks and emphasize stability.

The timing of the move, just weeks ahead of a sensitive Communist Party leadership transition, was likely to be an irritant for Beijing, and raised eyebrows among some economists and investors.

In...