Because he didn't want to.
Titan shifting must have three things to align, to transform completely and successfully.
- They must be injured enough to draw blood. (Self harm works) Examples - Anne's Ring or Eren biting his Thumb
- They must want to transform. A random injury doesn't always trigger a transformation. This would also be counter intuitive from a plot point of view. At some level a need for transformation must be there. (Example: Eren not wanting to die in the Titan's stomach inadvertently triggered his first transformation)
- A Clear purpose and Goal for the transformation. Eren's first transformation was triggered by his goal to kill all the titans. Meanwhile he failed to transform initially because he didn't want to fight Annie.
Only when these all combine is a Shifter able to transform.
Sources: Anime. I've kept all examples to the first Season of Anime. There are a lot more Manga sources as well.