What should you do if a co-author has an unethical affiliation?
To my mind, this case is very similar to the question of whether somebody can essentially pay for co-authorship.  We see many questions of this sort on this site, a particular apropos example of which is this one, which asks in part:


  Suppose I'm a billionaire who knows nothing about science, but I take it into my head that I want to be (regarded as) a famous scientist.


The case of the Saudi Arabian affiliations looks to me very much like a parallel construct:


  Suppose I'm a billionaire institution which does little significant research, but I take it into my head that I want to be (regarded as) a famous institution.


I think that it is completely reasonable to find this problematic, and to object to a co-author adding this institution, just as one might object to a co-author adding the billionaire know-nothing as another author.

Now the question is what to do about it, and, as in these authorship questions, the advice tends to depend strongly on the power dynamics of the situation.  On this site, we often advise students to leave bad situations rather than creating a confrontation, due to the power imbalance with faculty.  For people in positions of power, however, like tenured faculty, it is an effective endorsement of unethical behavior if you are aware of it and do not call it out.  It may not be a hill to die on, but either you care enough to make your voice heard or else you accept the behavior as legitimate.  

In this particular case, the student may have acted unwisely with regards to safeguarding their own future, but it may also have been important enough to them to take that ethical stand.  It's impossible for us to know how important it was to that person, and it's easy to engage in post-facto critique of their tactics, but I think the concern is legitimate and the actions taken are within the range of reasonable options, depending on how strongly the student felt about the ethics involved.

In short: some people choose not to take military money, not to work on espionage-related research, or not to publish in non-open journals.  Choosing not to be party to what you perceive as bribery for prestige is just as legitimate an ethical choice to make.