SEOUL—North Korea’s latest ballistic-missile test Wednesday appeared calculated to avoid crossing red lines that could provoke military action by Washington while demonstrating an advance in the country’s campaign to build nuclear weapons capable of striking the U.S.

Pyongyang said the test of its longest-range missile yet showed it could target the entire U.S. But the latest launch wasn’t as provocative as other steps it has threatened, including firing missiles at Guam, shooting down U.S. aircraft in international airspace,...