There are several countries that are considered intercontinental (i.e. existing in two or more continents). Two famous examples are Türkiye (Asia and Europe), and Egypt (Africa and Asia).
Panama is divided to two parts by the Panama Canal. The eastern part is contiguous with South America and the western part is contiguous with North America. So it makes sense to consider this country an intercontinental one. Also, it's good for the tourism of Panama (especially for its capital, Panama City which the Panama Canal runs in the middle of it).
Maybe some people argue that Panama Canal is man-made and because of that the country can't be considered intercontinental. But as I stated above Egypt is also an intercontinental country; despite Suez Canal is also man-made the Sinai peninsula is considered part of Asia.