The Panama and Suez Canals charge fees because they are artificial passageways, created by the blood and sweat of thousands. Both were huge investments.
The Panama Canal had cost 400-500 million USD and 25-30k lives to construct, when it opened in 1914.
The Suez Canal cost around 100 million USD and 100-120k lives to build in 1869.
Charging for transit through man-made infrastructure is fundamentally different from charging for passage through a natural international waterway.