Jefferson had two main, but very closely related, purposes in writing the Declaration of Independence. First, he wanted to gain support for the cause of American independence. Second, he wanted to explain why the Americans were trying to break away from the United Kingdom.
When the colonies were deciding to break away from the mother country, they needed all the help they could get. Not all of the colonists (or even most of them) supported the idea of independence. The colonies were quite weak militarily and even economically when compared to the UK. The pro-independence colonists needed more support from their fellow colonists and they needed support from people in other countries. By writing the Declaration, Jefferson hoped to gain that support.
Jefferson hoped to do this by explaining why the Americans wanted to break away. If he explained this, he might be able to convince people that the Americans were right in what they did. He might be able to convince them that the king’s actions had been bad and that the Americans were justified by political theories such as that of John Locke.
For these reasons, Jefferson wrote the Declaration.