Second, there's the Senate. Nearly half the Senate represents states whose populations together add up to less than the population of California. One half of Congress, in other words, is designed not as a democracy of the people, but a democracy of the states. If 88 percent of the country wants something to happen but the 42 senators who represent the other 12 percent of the country don't want it to happen, it doesn't happen. This has nothing to do with the integrity or competence of members of Congress. It's how Congress is designed.
Third, neither party stands for the same issues in all 50 states. It is wildly impractical to expect that country club Republicans in Connecticut will see eye-to-eye with evangelical Republicans in Texas on many issues. Republicans from the 50 states might be members of the same party, but apart from a common name and a handful of issues, many don't share much in common. Expecting Republican or Democratic unity on major issues is like expecting cats to march to the same drummer. Internally divided parties can't ram initiatives into law.
Finally, unlike in countries where major parties raise money en masse and distribute campaign funds to candidates nationwide, most members of Congress raise their own funds. As a result, they aren't beholden to their parties in the way legislators in the United Kingdom are, for example. Even if the national Republican or Democratic party had a unified agenda, it's impossible to impose such agendas on individual members. The parties have limited leverage in getting members of Congress to vote one way or another. Weak, fractured parties, whose members arrive in Congress with their own teams, their own campaign contributors, and their own agendas, have trouble passing laws.
Going back to FDR and even before, presidents have railed against "do-nothing congresses." The astonishing thing is how effective the argument has been for presidents, given that Congress is designed to be dysfunctional.
What we criticize as dysfunction or ineptitude is really an institution designed with a profoundly conservative vision—that's conservative with a small C. Congress is designed to stymie change. You can see this as good or bad, but that's not the point. The point is that it's silly to build a supertanker and then criticize the sailors because the ship doesn't maneuver like a speedboat.