It's a callback to the original Civ-basically, Gandhi's aggressiveness was set at 1 normally. However, adopting Freedom puts your aggressiveness back 2. This caused a bug where he'd go into the negatives and then the computer would put him at 12 to compensate, resulting in the hyper-aggro nuke-crazy guy we all know and love (Because you usually got your ideology around the time you got nukes). Firaxis basically just keeps that in now as a joke.
Imma nitpick - It didn't set nukes to 12 to compensate, the problem was a bit overflow: -1 didn't fit back then, so the data value for gandhi's nukes looped around to 127.
It's 12 nowadays because civ abilities will vary every game, -/+2. It's 12 so that it will always be 10 or above.