Panama Canal Zone was more than a military base.
From Wikipedia:
The Panama Canal Zone (Spanish: Zona del Canal de Panamá) was an unorganized territory of the United States from 1903 to 1979, centered on the Panama Canal in the Republic of Panama.
I don't know what SCOTUS ruled. but administrations and the military acted as if they were not on US territory. During WW-II all mail between US and Europe went through Bermuda where "censors" read it in violation of the 4th Amendment of the Constitution.
Alex
"There is a cult of ignorance in the United States, and there has always been. The strain of anti-intellectualism has been a constant thread winding its way through our political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."
-- Isaac Asimov