Its immediate purpose was to prevent the Soviet Union from dominating the exit from the Black Sea into the Aegean Sea and, from there, into the Mediterranean Sea.
This was the start of the policy of “containment.” The US did not want communism to spread out of Eastern Europe. The longer-term purpose of the doctrine was to establish the idea that the US would oppose communist efforts to spread their influence around the globe.