because we wanted to build a canal there, and the Colombians weren’t cooperating:
“When the United States sought to take over the canal project, the government of Colombia proved difficult to work with, and with the cooperation of a French financier, Panama simultaneously declared independence from Colombia [in 1903] and negotiated a treaty granting the U.S. the right to construct the canal.
“The United States was the first country to recognize the independence of the nascent republic, sending the U.S. Navy to prevent Colombia from retaking the territory during the early days of the new Republic. In exchange for its role in defending the Republic, and for constructing the canal, the U.S. was granted a perpetual lease on the land around the canal, known as the Panama Canal Zone, which was returned to Panama in 1999…
“After the United States, many other nations quickly recognized the independent republic, though Colombia refused to do so until 1909”
WikipediaThe separation of Panama from Colombia was formalized on 3 November 1903, with the establishment of the Republic of Panama. From the Independence of Panama from Spain in 1821, Panama had simultaneously declared independence from Spain and joined itself to the confederation of Gran Colombia through...
https://en.m.wikipedia.org/wiki/Separation_of_Panama_from_Colombia