What you are suggesting is happening, the collective punishment of a nation for terrorist acts, is a war crime:
https://guide-humanitarian-law.org/content/article/3/collect...
https://guide-humanitarian-law.org/content/article/3/collect...
this is all playing house. a real entity (like the US, UK, Australia, Urugay etc do) is participating in stuff like this... would you still hold the Taliban to the same standard? They are running Afghanistan but ... are they the real deal? No, lol.