Why is Gandhi so aggresive?

It is carry over joke that originated from previous edition bug.

Quote from civ wiki

The biggest thing that stands out about Gandhi is his nuke ratings of 12. These are 4 points ahead of the closest leaders (Catherine, Montezuma, and Shaka with an 8 in both categories), making him hands down the most nuke-happy leader in the game. This is intended more as a shout-out to previous games than anything else: in the original Civilization, due to a bug, the normally peaceful Gandhi would suddenly become extremely aggressive if he adopted a "peaceful" form of government, such as Democracy, which was often close to the time when nukes would be invented.

While I don't know developers motivation behind this choice, I always thought they took the following quote from Ghandi to the next level:

There was a time when people listened to me because I showed them how to give fight to the British without arms when they had no arms and the British Government was fully equipped and organised for an armed fight. But today I am told that my non-violence can be of no avail against the communal madness and, therefore, people should arm themselves for self-defence. If this is true, it has to be admitted that our thirty years of nonviolent practice was an utter waste of time. We should have from the beginning trained ourselves in the use of arms. But I do not agree that our thirty years' probation in nonviolence has been utterly wasted. It was due to our non-violence, defective though it was, that we were able to bear up under the heaviest repression and the message of independence penetrated every nook and corner of India. But as our non-violence was the nonviolence of the weak, the leaven did not spread. Had we adopted non-violence as the weapon of the strong, because we realised that it was more effective than any other weapon, in fact the mightiest force in the world, we would have made use of its full potency and not have discarded it as soon as the fight against the British was over or we were in a position to wield conventional weapons. But as I have already said, we adopted it out of our helplessness. If we had the atom bomb, we would have used it against the British. [emphasis mine]

It's a reference to one of their previous games. Ghandi was so peaceful that once a certain tech or political action(can't remember which it was) it made him go below 0 in aggression and that caused the game to rollback it so instead of being -1 in aggression he became a 255. Keeping Ghandi aggressive and nuke-happy ever since has been an inside joke sort of thing.