1. Securing the supply lines of the West and the stability of the world economy.
2. SA playing nice with Western powers and thanking them for their support. Not the other way around. The regional enemies of SA are Iran and Yemen. They have a strong behind-the-scenes intelligence relationship with Israel. They would do fine with Russian or Chinese weapons. Hell, they have enough money to kick-off their own military industrial complex.
I don't think the details of the arms deal are public but I suspect a lot of the money goes into "maintenance" from the weapons suppliers, not in technology transfer. They remain a vassal state to the US.
Their domestic human rights situation is despicable and disgusting, and I hate to find myself defending SA but the fake outrage over their foreign policy is highly irritating. They are no worse in that respect than any other country in the world, in fact the scale of their direct malfeasance is mostly regional. Countries with global reach have done worse in my eyes.