You seemed to ask 3 related questions:
Q1: (Title) Why did political parties form in the US?
Political parties form in a democracy when the people are divided and the sides want more power and there's no communication system that allows them to handle it another way.
In America, a division happened very early between the Federalists and Anti-federalists in Congress, and this schism then spread. Since it was about a philosophical issue and impacted many practical issues, it went on for a long time. Communication was very primitive, so parties formed and persisted.
After parties exist for a while, they tend to take on lives of their own, plus they attract extremists and corruption, so all kinds of stuff happens. But you just asked about why they formed.
Another way of looking at it is that representatives can't get power from the people unless they have a way to communicate well with them. This was missing, so they were on their own. Instead of representing people, they merely tried to do the right thing. They had to form groups to create power.
Q2: Why did America's founders not ensure parties would not form in the US?
Because they didn't know why parties formed. So they just hoped they wouldn't form. The Federalist Papers had a bit of reasoning why they would probably not form for a while, but it was based on ignorance. They didn't know what we know about individual and group psychology. And they didn't analyze existing systems well, like the British parties that existed at the time.
I rewrote the 2nd question in the first paragraph:
Q3: Why didn't America's founders ensure that elected officials were only accountable to their local constituents for representation rather than a party?
There's nothing in the Federalist Papers about accountability. The founders ASSUMED that voting would make representatives representative. We now have tons of evidence that it's not true. Even in America- where we vote for people, not parties- politicians represent wealthy donors and parties much more than they represent voters.
Probably, the founder didn't understand accountability, just as most Americans don't. I've asked nearly 1,000 people - two had accurate definitions of accountability.
So I did some searching, including in old books that are online. There were some decent definitions, but no good ones. And when I looked up "political accountability," the definitions were either inaccurate or were a watered-down version of accountability. Why? I'm guessing because there's so little, so they wanted to use the term for what exists in democracy. (In the last decade, better definitions have surfaced.)
So I defined it rigorously, and then functionally.
Accountability occurs when someone must answer honestly about their responsibilities. By "must", I mean there's compelling pressure.
Don't think just accountability, think: accountability to whom and for what. Often the entity to whom one is accountable defines what one is accountable for.
Political accountability in a democracy is a relationship between an elected official and their constituents where the voters together assert the pressure. For representatives, their job includes carrying out the wishes of voters as well as obeying laws, so there must be an accessible way for voters to state their wishes. To assert pressure, voters need to know what they all want, so they can know what the rep should be doing. Better, voters should also know what all voters want in order to know what they should be able to expect from a rep.
I began figuring all this out a bit over a decade ago. I've designed a political communication system to accomplish this, and have begun a website PeopleCount.org. There's no app there yet, and there's nothing to sell, just the page and my blog. I have no support so it'll take a while. The design will allow voters to work together to manage their representatives so that reps are fully accountable to voters. It will free representatives from needing to be accountable to either the parties or large donors. It will be rewarding to use for both politicians and voters.
s/understand/supposed/
. The problem being that a party machine has its own interests and works to unobtrusively replace its larval founding group's goals with its own.