The Taliban was a sovereign state that, for a basket of reasons, actively supported terrorist attacks on the US. The invasion of Afghanistan was a war.
Al Qaeda is not a sovereign state; they're a criminal organization.
What makes it difficult to prosecute Al Qaeda using US criminal procedure is the fact that they're mostly non-citizens, mostly operating out of the US, mostly in countries that are not especially cooperative with the FBI.
In fact, I think my counterargument says that the "grave problem" is the opposite of the one you pose. It's not that prosecuting Al Qaeda criminally risks corrupting the criminal justice system. It's that prosecuting them as a sovereign who we're at war with has demonstrably corrupted the military.
The US constitution even has provisions for it: Congress can call forth the militia to suppress insurrection.