It is to get the people making the decision reelected. It is to give the government party control of the spending of other political parties that might replace them [1].
This decision had a very specific aim, and achieved exactly that aim. In very predictable fashion it did a ridiculous amount of economic damage to the country in the process, but that shows nothing more than what the priorities of Mr. Modi are.
It was very well received (judging by voting afterwards) and further cemented the current party into power. That was the purpose. That aim was achieved. Why was the timing what it was ? It was election time ... [2]
Immediately before this "make or break" (dixit BBC) election BJP suddenly made itself the only party capable of doling out cash and other direct political favors in that state. Coincidence ?
No.
[1] https://www.forbes.com/sites/timworstall/2016/12/17/this-is-...