The Monroe Doctrine was a further indication of the United States' intention to remain isolationist and uninvolved in the affairs of Europe. It came about when there was fear that French troops, which had invaded Spain to restore the Spanish king, would attempt to restore the Spanish Empire in the Americas. Previously Russia had attempted to claim lands well below the 51st parallel as part of Alaskan territory. At that point, Secretary of State John Quincy Adams had stated that the America's were closed to further colonization. President Monroe at first considered an alliance with England to oppose any Spanish moves in the Americas but followed Quincy Adams advice and remained neutral. Adams famous quote was:
It would be more candid as well as more dignified to avow our principles explicitly to Russia and France than to come in as a cockboat in the wake of the British man-of-war.
The Monroe Doctrine, announced by President Monrow in a Presidential message to Congress in 1823 allowed the U.S. to avoid committing to an alliance with Great Britain when he knew it was in Britain's interest to avoid restoration of the Spanish Empire.
The doctrine had no weight as international law, and wasn't even called the Monroe Doctrine until 1852. It didn't even bother the European powers enough for any of them to renounce it. It allowed Monroe to flex some American muscle at a time when he knew he could depend on the British navy to keep other European nations out of the Americas.