It's both. If you hear his words after the game, you can see he feels Pique's words have influenced the referees to somehow hurt RM. So to me, he is clapping at both Pique for influencing the ref, and the ref himself for being influenced.
In any case, it clearly a reaction to the refereeing decision and just as the RFEF cannot tell the exact motive of Neymar's clapping, just that it was a reaction to the refereeing decision, so they cannot tell the exact motive of Ramos clapping, just that it too was a reaction to the refereeing decision.
If they were to be consistent, both would have to be punished accordingly.
However they wont be, as Ramos' reaction was unsurprisingly omitted from the refs report.