I don't care for the ref, he's just a muppet doing his job he's told to do. It's a pen though, a shot is deflected with a clumsy defender who lost his position in the box.
Do not diverge from the pen incident to the overall gameplay. Those two aren't connected, if it's a pen, then whistle it...