The Truman Doctrine, 1947, defined U.S. foreign policy for the next 20 years. It initiated a policy of containment for the prevention of the spread of Communism. The United States would support free people who were resisting pressure from nations who wanted to convert them to communism. The United States would support democracy around the world, by pledging money to help them.
The Marshall Plan basically paid to rebuild Europe after WW II. The amount was staggering. "Over the next four years, Congress appropriated $13.3 billion for European recovery. This aid provided much needed capital and materials that enabled Europeans to rebuild the Continent's economy."
We paid this money so Europe could rebuild and become stable, both economically and politically and would not fall into Communist hands. So technically both policies were designed as containment measures against the spread of Communism in the free world after World War II.