MARJAH, Afghanistan—It is hard to know whether Monday was a very bad day or a very good day for Lance Cpl. Andrew Koenig.

On the one hand, he was shot in the head. On the other, the bullet bounced off him.

In one of those rare battlefield miracles, an insurgent sniper hit Lance Cpl. Koenig dead on in the front of his helmet, and he walked...