He made a stupid dive while trying to sell the penalty. The ref could either bite it or show him a yellow. And that dive was so bad that it was really an easy choice. Clear yellow just like the dive of Bayern player later in the game where he also showed a yellow.