Because Time Lords are allotted thirteen regenerations.
That's basically all there is to it. There was never any problem with the Doctor having thirteen faces; the first time he really broke the rules of regeneration was when he got a fourteenth.
CLARA: But you don't die. You change. You pop right back up with a new face.
DOCTOR: No, not for ever. I can change twelve times. Thirteen versions of me. Thirteen silly Doctors.
CLARA: Okay, so you're number eleven, so ...
DOCTOR: Ha. Are we forgetting Captain Grumpy, eh? I didn't call myself the Doctor during the Time War, but it was still a regeneration.
CLARA: Okay, so you're number twelve.
DOCTOR: Well, number ten once regenerated and kept the same face. I had vanity issues at the time. Twelve regenerations, Clara. I can't ever do it again.
-- The Time of the Doctor (2013 Christmas special; emphasis mine))
You've counted his regenerations wrongly: the Meta-Crisis event was his eleventh use of regeneration, not his twelfth. Here are all his regenerations in order up to the point where the Time Lords gave him new ones after the dialogue quoted above:
- First to Second (Hartnell to Troughton)
- Second to Third (Troughton to Pertwee)
- Third to Fourth (Pertwee to Tom Baker)
- Fourth to Fifth (Tom Baker to Davison)
- Fifth to Sixth (Davison to Colin Baker)
- Sixth to Seventh (Colin Baker to McCoy)
- Seventh to Eighth (McCoy to McGann)
- Eighth to War (McGann to Hurt)
- War to Ninth (Hurt to Eccleston)
- Ninth to Tenth (Eccleston to Tennant)
- Meta-Crisis (Tennant to Tennant)
- Tenth to Eleventh (Tennant to Smith)