The thirteen original British colonies in North America,
some formed as commercial ventures, others as religious havens, each had a written charter that set forth its form of government and the rights of the colonists.
if we look at the non-underline sentence fragment "that set forth
its form of government and the rights of
the colonists" -> the sentence is describing "each" colony one at a time.
A) some formed as commercial ventures, others as religious havens, each had a written charter
B) some being formed as a commercial ventures, others as religious havens,
all of which had written charters ->
Because of the above issueC) some that as commercial ventures, others as religious havens,
all had written charters ->
Because of the above issueD) with some being formed as a commercial venture, others as religious havens,
all had written charters ->
Because of the above issueE) with some formed as commercial ventures, while others as religious havens, each had a written charter
now with can be used as adverbial phrase (most of the time) and sometimes, with is used to modify the subject.
Here with can be used to modify the subject - Colonies.
Now in option E)
with some
formed as commercial ventures, while others as religious havens, each had a written charter
"with" used to modify the colonies
"formed" is also used to modify the colonies.
The correct option E)
could be -> "with some as commercial ventures, while others as religious havens, each had a written charter"
Now with is modifying the subject -> colonies.
Hence A) is correct.