Why does the US have the right to test advanced weapons but other countries can't, like North Korea or Iran getting sanctions for testing advanced weapons?

为什么美国有权试验先进武器,而其他国家却不能,比如朝鲜或伊朗因为试验先进武器而受到制裁?