Most presidents are pragmatic. Teddy Roosevelt “took” the site of the Panama Canal. Jefferson bought the Louisiana Purchase Territory. The list goes on and on.
The Panama Canal, as in a failed French engineering project, hampered by tropical diseases (22,000 deaths on the project). The US acquired project reliant upon Dr. Walter Reed’s expertise in tropical disease vectors, to achieve a healthy workforce, allowing the project to advance.
The US already had a stake in the region established by treaty, and had built a military administered railroad linking Atlantic and Pacific coasts: see MallarinoBidlack Treaty of 1846. Panama was a disease hellhole before improvements changed the character of the tropical jungle region. Once the area was in ascendency, a successful canal bringing prosperity, Columbia sought to claim the region.
The Panamanian separatist of the former New Granada, were in revolt against any claim of rule from Columbia; and, Teddy formally recognized them as a nation, blocking Colombian military entering the isthmus. Everyone wound up being paid by the US, even Columbia to relinquish further aggression.