He didn't really have to do it on purpose; the lateness of the hit is enough to draw the call. The goalie sort of forced the ref's hand there, but I think he made the right call. It is just unfortunate, is all.
@Fighters: He could have got the goal, but it was a low probability - he let the ball get away from him a bit. That's why I said DGSO was debatable. Getting a PK for his team was a safer option. The red card was just icing.
Compare with the Swiss goal where two Spanish defenders went mental Denying Goal-Scoring Opportunities and got away scott free because of course they failed (to deny a goal). Mad law, if the Swiss had missed it would have been a penalty and Spain would have been down to nine men. None of it matters now, but it is very interesting.