Most classes of pre-dreadnought and dreadnought battleships until around WW2 (depending on the country somewhat) had at least a few torpedo tubes. What was their tactical function? The heavy artillery of the dreadnoughts had much longer range than the torpedoes would ever have, and if the enemy was close enough for torpedoes someone had already screwed up, as the enemy could shoot some back at you.
The submerged torpedo tubes on capital ships were a novel idea of the pre-First World War period that wartime experience soon revealed was deeply flawed.
The torpedo was a weapon more suited for smaller, more maneuverable ships. Additionally, torpedo ranges were much closer than the ranges at which the larger caliber guns fired; Rodney fired her torpedoes as she closed in on Bismarck when the latter was a flaming hulk without her main battery. Nonetheless, the torpedo was a cutting edge weapon when it was introduced over the latter third of the nineteenth century. Much as the battleship evolved in this period into a giant steel warship, the torpedo became more a more sophisticated weapon. It was unclear in the contest between bigger guns and bigger torpedoes which would prevail in a future naval conflict, especially as naval design was in a constant state of flux.
Capital ship torpedo partisans argued that by lowering the torpedoes' speed settings they could be in range. By the same token, the torpedo allowed for a battleship both to attack another warship below the waterline. Just as offensive weapons were in a state of flux in the decades before the First World War, so too were defensive systems such as armor and watertight compartimentalization. But changing the speed settings negated one of the chief attributes of a torpedo, its speed. In 1919, the RN's Director of Naval Construction noted the possibility of using both guns and torpedoes "in an action is only likely to confuse the mental attitude of those in command and cannot make for the greatest efficiency."
Experience at Jutland showed the DNC correct. Not only were these tubes tactically near useless, they posed a significant danger to the ship itself. Torpedo rooms were large spaces and their submerged tubes increased risk of flooding. The large torpedo rooms on Lutzow likely contributed to her extensive flooding and loss at Jutland. Moreover, the presence of such large warheads on the ship was an additional risk if the ship were to take a hit in this area. Interwar refits of capital ships generally removed the tubes as they were a weight liability and wartime experience had shown they were more trouble than they were worth.
Sources
Brown, D. K. The Grand Fleet: Warship Design and Development, 1906-1922. Annapolis, Md: Naval Institute Press, 1999.
Moretz, Joseph. The Royal Navy and the Capital Ship in the Interwar Period: An Operational Perspective. London: Frank Cass, 2001.
Effective main battery ranges and the theoretical maximum range of torpedoes pre-WWI were actually fairly close (both were approximately 10,000 yards" with obvious variations depending on visbility, sea state, etc.). There'd been considerable improvement in torpedo design (when HMS Dreadnaught was launched, torpedo ranges were about 3,000 yards. By 1914, developments in wet-heating torpedoes stretched the range to 10,000 yards and if the torpedoes' speed was reduced to 20 knots, they could reach up to 15,000 yards. On paper at least, it was possible for a battleship to employ its main battery and its torpedoes against the enemy battle line.
Of course, it'd be a long shot. It could take up to ten minutes for a torpedo to cross that distance. Misjudged range, enemy manuevers, or strong currents made it easy for a torpedo fired at such extreme ranges to miss. However, an entire line of battleships firing torpedoes could play a numbers game. One battleline firing 10-20 torpedoes at an enemy battleline 10,000 yards long had some chance of scoring a hit. That, at least, was the theory.
In reality, torpedoes on battleships and battlecruisers caused far more trouble than they were worth. Underwater tubes routinely leaked and flooded, which caused headaches for their crews. Putting torpedoes packed with fuel and explosives in a barely-protected position below the waterline also created an obvious vulnerability. To top it all off, they didn't hit much. At Jutland in May 1916, battleships and battle cruisers fired a total of 21 torpedoes at one another. The Royal Navy fired 13. The Germans fired 8. None of them hit.
During WWII, there was another battleship-on-battleship torpedo attack, when HMS Rodney tried to torpedo the dying Bismarck on May 27, 1941. Rodney missed (probably).
One interesting footnote to history was the "torpedo battleship" concept. In 1907, American naval designer Lieutenant Commander F.H. Schofield proposed a battleship armed primarily with torpedoes, not guns. The result was a kind of massive, (somewhat) armored torpedo boat that would rely on its speed to fire off its torpedoes at long (~10,000 yard) range. After initial interest, the problems with the design became insurmountable and destroyers became the preferred torpedo-launching platform.
In 1913, Russian inventor P.V. Iankov proposed an even more radical idea. His proposal had only a dozen 7" guns...and 84 torpedo tubes.
Sources:
Torpedo: The Complete History of the World's Most Revolutionary Naval Weapon by Roger Branfill-Cook
Torpedo by Katherine C. Epstein