In the early days, Colonial Americans had British accents indistinguishable from the British. (In fact, linguists have studied the speech patterns of isolated groups of descendants of English settlers in the Appalachians to try to understand better how English was spoken in the seventeenth century.)
The early colonists identified as British, not American. Plymouth Plantation, for example, was settled by English Puritans who left the safety of Holland in part because they did not want their children assimilating to Dutch culture. They specifically came to America to preserve both their religious freedom and their distinctly English culture.
Gradually, over time, the two accents, British and American, began to diverge, but this was a long, slow process. People tend to imitate the speech patterns of the fashion leaders in their own cultures and this is what began to occur in both America and England. Over time, cultures develop their own slang and their own pronunciations of certain words. As this happened, the accents of the British and the Americans became distinct, as did the cultures. Many native-born Americans of English descent who had never been to England began to identify as American rather than British.
It is worth noting that most linguists believe the English people of the 17th and 18th centuries spoke a more guttural—more American—English than they do now, and only in the 19th century developed what we think of today as the English accent.