Umm, it was. The Taliban was the government. Now it's not, and only controls the border region with Pakistan, and makes occasional guerrilla/martyrdom operations outside that area.
The current Afghan government is an organizational joke, loosely based on a warlord jirga. Any semblance to a functional government is purely coincidental. The US and NATO went to great lengths to insure that the “traditional” ways of Afghan government were preserved.
The trouble is that their traditional means of government are awful.
And no, the Taliban were never a functional government. The best it can be described was as “rule by whim”, with no individual or council in charge, no law, and enforcement by gunfire from whoever had the gun.
However, before the Taliban, there was the Soviet puppet, and before him, there were other forms of government. And not one of them was worth a damn. The country truly needed to start from scratch.