When the Monroe Doctrine was written, the US had just formed and was not ready to fight the European powers. Monroe basically asked Europe to stay out of the Western Hemisphere because they were afraid of getting attacked.
The creator, James Monroe, was interested in keeping the United States out of a war it was not prepared for. Though it was out of fear, there was some thinking through; people voted on it, after all.
Note that by "afraid of getting attacked," I not only mean getting attacked through soldiers and cannons but also by taking over nearby areas and competing with the US for natural resources.