12 Go, and say to David: Thus saith the Lord: I give thee thy choice of three things, choose one of them, which thou wilt, that I may do it to thee.
13 And when Gad was come to David, he told him, saying: Either seven years of famine shall come to thee in thy land: or thou shalt flee three months before thy adversaries, and they shall pursue thee: or for three days, there shall be a pestilence in thy land. Now therefore deliberate, and see what answer I shall return to him that sent me.
14 And David said to Gad: I am in a great strait: *but it is better that I should fall into the hands of the Lord (for his mercies are many) than into the hands of men.
15 And the Lord sent a pestilence upon Israel, from the morning unto the time appointed, and there died of the people from Dan to Bersabee, seventy thousand men.
David had a choice. And he chose as sovereign of nation. Plus, as commentary explains he chose to be "exposed to the violence of pestilence, which attacks both rich and poor; whereas the rich can frequently escape the dangers of war, or of famine."
Plus chapter 21 tells us that there was famine for 3 years already