Monroe told Europe to stay out—then lacked a navy to insist
The Monroe Doctrine, voiced by President James Monroe on 2 December 1823, opposed foreign interference in the Western Hemisphere as potentially hostile to the United States. Aimed at European colonialism as Spanish America won independence, it was named for him only in 1850.
The idea had a long prehistory. Alexander Hamilton, in The Federalist Papers, already imagined a United States strong enough to keep European powers out of the hemisphere, even though they then held far more American land than it did. Under Jefferson, Secretary of State James Madison told the envoy to Spain that Washington opposed new European acquisitions, and the government let its diplomats know it would back no further colonisation of North America.
The immediate worry came from Europe's victors. After the Congress of Vienna, Prussia, Austria and Russia joined in a Holy Alliance to shore up monarchy and sanctioned military efforts to restore Bourbon rule over Spain and its rebelling colonies; France had even agreed to help restore the Spanish king in return for Cuba. Britain, whose factories wanted open Latin American markets rather than Spanish mercantilism, had quietly aided the South American rebels and proposed a joint declaration, which Washington declined so soon after the War of 1812.
The text was drafted mainly by Secretary of State John Quincy Adams. Its two key passages declared the Americas closed to future European colonisation and warned that any attempt to extend the European system to independent republics would be treated as dangerous to American peace, while promising not to disturb colonies that already existed. Austria's Prince Metternich privately fumed that it was a new act of revolt that would embolden conspirators everywhere.
For decades the Royal Navy was in practice the only force upholding the policy, since the American navy was small, and France still intervened in Mexico a second time. Only around 1900 could the United States enforce the principle itself, a turning point in its foreign policy.
Source: Monroe Doctrine