It was more a case of what he wasn't doing, Scotman.
My refereeing experience might have been at a much lower level but even I know that failing to immediately retreat 10 yards from the ball at a free kick (thus unfairly giving defenders time to organise themselves, and to mark opponents) constitutes 'ungentlemanly conduct' and thus merits a caution.
Elvis:
I didn't see the match but I've just taken a look at the second incident. Even if there was no intent to commit a foul, "lunging at Sergio Ramos like a kamikaze Cossack dancer" (to quote from 'The Guardian') showed a complete disregard for the safety of his opponent, which could reasonably be construed as 'ungentlemanly conduct':