I got the impression that torpedo bombers had a harder time hitting a ship compared to dive bombers but if they did, they could deal more damage. Maybe the explosive shock wave of a detonation is more powerful in water?
It can be, it depends on the depth of the water. A bomb exploding on the surface (unlikely to explode at the exact surface) of the water has much of it's force dissipated into the air. Much more than 50% because the air offers a path of less resistance than the water does. As the bomb (or torpedo) explodes further beneath the surface more of the force goes into the surrounding water but a fair amount still goes up until you get deeper than most ship hulls.
If the explosion takes place next to the ships hull much of the force is directed against the ships hull as that, depending on it's construction, is the path of least resistance for the explosion.
Note the straight line of the lower edge of the armor plate. a torpedo exploding 15 ft below the surface is trying to lift about 960lbs of sea water per square foot of the explosion area.
Water is technically incompressible but you can put it under a huge amount of pressure. It is not just the shock wave but the venting of the gases generated by the explosion. Which way is the fastest, easiest way for the gases to vent?
Please note that torpedoes for much of the war carried more explosives than common bombs. British 18 in aerial torpedo normally used 388lbs of TNT in the warhead. A British 1000lb GP bomb was around 330lbs of TNT, The 500lb SAP bomb used by the Skua held 90lbs of TNT.
For the US the MK 13 aerial torpedo started with 401lbs of TNT and ended the war with 600lbs of Torpex. American GP bombs held about 50-52% of their weight in explosive.
A near miss by a large bomb could be quite damaging but problem is what is meant by "near" a few hundred feet might as well be a mile.
A single hit by a torpedo could let thousands of tons of water into a ship, and the water could flood vital compartments (like engine rooms or machinery spaces) while a bomb exploding on the deck or even two decks down on a large ship may not let any water into the ship directly. Fires, disruption of fire control equipment, damage to weapons and sighting systems and even damage to machinery could be done by bombs but the bombs needed to be suited somewhat to the ship. Small unarmored ships hit by 500lb Semi AP bombs might wind up with a 12-15in hole right through the ship with no explosion. the same bomb might not make it though the armored deck of a battleship.