Because the sponsor behind that part of the bill paid congressmen to vote for it.
For example, the NGOs administering this program will need lots of consultants for handling (paying off) Pakistani officials, setting up offices, etc. This will all be contracted out at enormous expense to former government officials, foreign officers, ex-military, etc.
Government funding of NGOs hides the parasites feeding off the system. Because they and not the government make the contracts, there's no transparency. In the end, only a fraction of the money is actually spent in Pakistan. Most of it is consumed here.