Security and cash. Long contact on (i'm guessing nearing 100k a year) vs whatever they make as a SA contracted player but without the risk that they could be dropped/injured at any time.
Aside from the possibility of the Kolpak door closing on him, I suspect the logic is thus:
1. Olivier may not be a first pick in any format. In tests, as well as he bowled, he would likely be behind Steyn, Philander and Rabada in a four man attack and if they went five man Mulder or Phelukweyo offering more with the willow would count against him. Ngidi, meanwhile, will be first reserve.
2. In terms of his financial future he is not the type of player chosen for T20 leagues, so this is his easiest him of cash. Given the South African economy, who can blame him?
3. Doors have hardly closed. If in 18 months the selectors say dude, you're first pick, he can negotiate ways around things.