The United States used to have a unicameral system under the Articles of Confederation. Under the articles, each state would get exactly one vote. However, when the Constitution was being debated, there was a debate as to whether a state's representation in Congress should be proportional to its population, or whether all states should have equal representation in Congress.
Unsurprisingly, large state preferred proportional representation, whereas smaller states preferred that all states have equal representation. This resulted in the Connecticut Compromise, in which there would be a bicameral legislature. The Senate would give each state two representatives, and the House of Representatives would give each state representation proportional to its population (though the proportionality has since been compromised by the Reapportionment Act of 1929).
This is not to say that the necessity of a compromise between large states and small states was the only reason given in support of bicameralism. James Madison defended the Senate and bicameralism in Federalist Paper 62, believing that the United States, as both a single country and an assemblage of states, should have two forms of representation.
If indeed it be right, that among a people thoroughly incorporated into one nation, every district ought to have a proportional share in the government, and that among independent and sovereign States, bound together by a simple league, the parties, however unequal in size, ought to have an equal share in the common councils, it does not appear to be without some reason that in a compound republic, partaking both of the national and federal character, the government ought to be founded on a mixture of the principles of proportional and equal representation.
However, Madison also recognized that the Senate was borne mostly of political necessity, and not because it was necessarily the ideal system:
A common government, with powers equal to its objects, is called for by the voice, and still more loudly by the political situation, of America. A government founded on principles more consonant to the wishes of the larger States, is not likely to be obtained from the smaller States. The only option, then, for the former, lies between the proposed government and a government still more objectionable. Under this alternative, the advice of prudence must be to embrace the lesser evil; and, instead of indulging a fruitless anticipation of the possible mischiefs which may ensue, to contemplate rather the advantageous consequences which may qualify the sacrifice.
This paper also addresses your concern about gridlock. The founders viewed the fact that bicameralism puts up another barrier to the passage of legislation as a potential advantage. In the paper, Madison argues that this is a feature, not a bug:
Another advantage accruing from this ingredient in the constitution of the Senate is, the additional impediment it must prove against improper acts of legislation.
Given that the latest congresses have been the least productive in history, it is likely that the founders underestimated how much gridlock the system could actually cause. However, the idea that different parts of government should be able to check the power of other parts of the government is not exclusive to Congress. The government was deliberately set up with different branches so that there would be a separation of powers, and no single branch could do everything on its own.
In short, bicameralism was a product of political necessity, after a number of unicameral proposals for legislatures had failed or been rejected, and various disadvantages of bicameralism were viewed as potential advantages.