It was a donation with conditions. International aid always comes with conditions as to how the money is used and managed, and donations to third world countries often include conditions relating to tackling corruption. There was nothing nefarious in that case. That prosecutor was obstructing corruption investigations, it would have been irresponsible to allow the money to go into Ukraine without ensuring the Ukrainian government was serious in tackling corruption.
Here's a UN report on aid agencies using their influence on recipient countries to demand better governance and fight corruption. So the answer to your question is, it was responsible aid management in line with international norms.
https://www.unodc.org/documents/treaties/publications/aid_ag...