From the very first game in the series through to today, India's supposedly-peaceful leader Gandhi has been famous for one thing: dropping nukes. And there's a very good reason for it.
It's not your mind playing tricks on you, or a case of myth becoming accepted fact, he really does drop nukes more than other civs. Like any other leader in the series, Gandhi has pre-determined statistics that govern his behaviour, making him more likely to do certain things and behave in certain ways.
His preference for nukes doesn't just make the latter portions of a game messy, though, it's a behaviour that stands in such stark contrast with his pacifist approach in the real world that it's become Civilization's defining joke.
So why does he do it?
In the original Civilization, it was because of a bug. Each leader in the game had an "aggression" rating, and Gandhi - to best reflect his real-world persona - was given the lowest score possible, a 1, so low that he'd rarely if ever go out of his way to declare war on someone.
Only, there was a problem. When a player adopted democracy in Civilization, their aggression would be automatically reduced by 2. Code being code, if Gandhi went democratic his aggression wouldn't go to -1, it looped back around to the ludicrously high figure of 255, making him as aggressive as a civilization could possibly be.
In later games this bug was obviously not an issue, but as a tribute/easter egg of sorts, parts of his white-hot rage have been kept around. In Civilization V, for example, while Gandhi's regular diplomatic approach is more peaceful than other leaders, he's also the most likely to go dropping a-bombs when pushed, with a nuke "rating" of 12 putting him well ahead of the competition (the next three most likely to go nuclear have a rating of 8, with most leaders around the 4-6 region).
So the next time you see the AI lay waste to an entire continent, and wonder if it's just co-incidence or a quirk of the game that it's Gandhi, know that it's not. He's meant to be an asshole, because he's programmed that way.