Besides that, international legality is defined solely by the countries with the biggest sticks. That will always be true, without exception. The UN and all global bodies of justice and rule setting derive their authority and possess capability solely at the permission of the most powerful nations.
The world isn't run by the UN, international legality isn't defined by 195 nations, it's all run by six or seven countries (which control the majority of all economic activity and by far have the most powerful militaries). The UN is a lever for those powerful nations to keep order in dealing with all the others. It's a means to herd cats.
There's a quote by a rather vile heiress named Leona Helmsley, paraphrasing: taxes are for the little people. Respecting sovereignty is only a fixed rule for the little countries. Why? Because of how consequences work and who can dish them out. I'm not advocating that, mind you, I'm saying that's actually how the world works and always will. You see it with every empire that has ever existed, you see it with the US, Russia, China, etc.
"I wouldn't call Pakistan an allied country of the United States"
"Pakistan joined the "War on Terror" as a U.S. ally. Having failed to convince the Taliban to hand over bin Laden and other members of Al Qaeda, Pakistan provided the U.S. a number of military airports and bases for its attack on Afghanistan, along with other logistical support."
https://en.wikipedia.org/wiki/Pakistan%E2%80%93United_States...
Before you yell about wikipedia as a source, consider that this is a well-known fact.