But my hypothesis is time relative, as countries participate in more treaties and agreements, the less they arm them selves. Note that USA has been a significantly worse participate in agreements and treaties as your average western nation, and is also the country which is increasing their arms spending at the greatest rate. Note Europe is also increasing their arms spending, which is why I provided the second hypotheses, that an increased war correlates with increased arms buildup. Europe has been seeing more wars lately, and they are in turn increasing their arms buildup.
Finally, why is South Africa on that list? South Africa has consistently been reducing their arms spending by around 5-10% every year, for the last 5 years at least. And historically (during apartheid) it was one of the most militarized countries on earth. It was also famously not part of hardly any agreements or treaties (as it was sanctioned for their apartheid polices). After apartheid ended South Africa started participating in almost all the treaties and agreements which a modern democracy is expected to (going even further than most western countries). And even famously dismantled their nuclear weapons program. South Africa should be a most prominent example in favor of my hypothesis.