The show failed for these reasons...
1) As a European, around the end of Season 1 most of the world was fed up with it. As far as we saw, Americans had created yet another propaganda show blaming the middle-east and North Korea during their disgusting Iraq and Afghanistan wars. At the time we all kept laughing that since 2001 we had been told that "hating Americans was a fad" and other such pathetic nonsense they used to justify their illegal wars.
With the sudden advent of blaming Iran, all we saw were just another moronic attempt to justify their own ignorance. Akin to all your "ticking time bomb justifies torture" claims. The same anger towards such American ignorance and arrogance came from those in Australia and Canada as well.
So, while a small amount, the rest of the world suddenly lost interest in the show. Which cut off a lot of viewership for season two before it even started.
But hey, there's still the American audience, right?
2) Americans, in an ironic twist, started to stop watching the show in droves in season 2 because of the sheer number of conservative viewers suddenly finding the idea that a government or corporation could lead them into something like that to be abhorrent. Previously drawn to the show because of its "Patriotic" small town fighting for survival against terrorism, they suddenly found themselves in Season 2 to be facing the very opposite of their ignorant ideology.
These are effectively the reasons the shows viewers left and the show ended as it did.