At that time, Russia was expanding its territory from Alaska down the west coast of the North American continent and the people in the United States was afraid that the Russians would cut the Americans off from its window to the Pacific Ocean. This, combined with the fact that the Americans were also profiting from the monopoly free ports of Latin America motivated the United States to make some kind of declaration. There was opposition to a joint declaration with Great Britain because they didn't want to be morally held back from acquiring Spanish lands in the Americas. John Quincy Adams correctly saw that even if the United States did not join Britain the British would still protect the ports so he advocated a declaration by the United States without the British.
President Monroe announced to the world during his regular annual address to Congress that the era of colonization was over in the Americas and that the European powers were not to interfere in the new Latin American republics. Since Monroe said it, this "doctrine" was named after him. The Monroe Doctrine could be said to be a self-protection doctrine because the noncolonization part was mainly directed at the Russian who were expanding down the west coast and if they were stopped, the United States would be guaranteed access to the Pacific Ocean. The noninterference part was another way