It's not so insane when you consider that they have nuclear weapons and are right next to (and hostile towards) another country that has them too. The U.S. will do almost ANYTHING to keep the peace in that region.
I guess you mean that they will do anything to avoid war between India and Pakistan. Peace is not a term I would use for Pakistan.
And they know that it's better to have a corrupt-as-hell extortionist scumbag military in charge, and at least maintaining a status quo peace, than to take their chances with an Arab-Spring type popular radical government that might easily stumble into a regional nuclear war and possibly set off WWIII.
That's pretty much exactly what I said in my sentence that started with "This aid is moreover not entirely voluntarily any more today
That doesn't make it any less insane or counter-productive though. It's insane to think that this status quo can be be maintained. It's insane to think that this prevents nuclear proliferation, because as the article mentions, this has already happened in the past from Pakistan and there are no indications that it won't happen again in the future. It's insane to think that by supporting a dictatorship, you will be able to somehow suddenly get lots of friendly people afterwards (as indeed the Arab Spring demonstrated -- note that the Arab Spring did not start with or include Western boycotts against the dictators -- except when some dictators' positions became untenable). It's insane to think that this will not result in more IS-like insanity in the future (or to think that IS-like madmen won't be able to get their hands on dirty bombs or nuke materials in other ways).
I fully agree that there is no easy and quick solution for the situation (which, as the article notes, was actually for a large part created by the US itself, just like in Afghanistan). Just pouring more money into a corrupt dictatorship will however later inevitably result in throwing the hands in the air and more short-sighted people yelling of "look at all those barbaric Muslims that hate our guts for no reason other than that they follow a retarded religion and are incapable of setting up properly functioning governments, and all of that in spite of the billions in aid that we gave them"... As I tried to express in my original message, my point was mainly related to that: these violent reactions to YouTube etc have probably little or nothing to do with fact that they are Muslim. It's just one of the very few ways they have to express their anger such that the military tolerates it (since it's directed against an external entity).