There are a few major reasons why the United States went to war with Great Britain in 1812. At the time, France and Great Britain were already at war. Great Britain was going to great lengths to ensure that the United States did not trade with France. The British navy blockaded French ports, which was a huge blow to international commerce. Furthermore, the Royal Navy began the practice of impressing American sailors, which the United States saw as a serious violation of American sovereignty. In 1809, Congress passed the Non-Intercourse Act which prohibited all trade with France and Great Britain as long as they were at war. This brought trade with the two nations to a near standstill and was proving catastrophic to American business interests.
Furthermore, along the northwestern frontier of the United States, tensions with Native Americans were worsening. When the British forts in Canada began augmenting their garrisons with potentially hostile native parties, a fear that the British were encouraging an insurrection across the border intensified. At this point, a group in congressmen known as the War Hawks began arguing that only the removal of the British from Canada would neutralize the Native threat.
As a result of worry about a threat of British supported insurrection coming out of Canada and the continuing violations of America's maritime rights, the United States declared war on Great Britain on June 18, 1812.