The penalty was for hitting the QB in the face. Yes, it looks like a glancing blow that smacked the face mask and yanked the head downward. the penalty was legit.
Which just proves a lot of these rules are ridiculous. Judgement should be used regarding if physics cannot stop it from happening. Following rules by the letter rather than spirit is what makes many of these spurious.