Torpedoes aren't close-in weapons. Nothing is lost if they cannot reach a target that sits a hundred meters above the ship, because if they were detonated a hundred meters above the ship, the ship herself would be destroyed, too.
In today's warships, it's of crucial importance that the radar-controlled CIWS cannon are placed so that they can cover every possible approach angle of a hostile missile, and keep on firing at it until literally the last second. It is of no importance where the anti-aircraft missile launchers point, though, because they will never fire into the possible "blind spots" anyway. They will only fire at targets that are so distant from the ship that there are no blind spots created by the ship's structures there.
Submarines of old used to have aft-pointing torpedo tubes, partially because the subs were a bit clumsy and couldn't always bring their bow tubes to bear. An equally important factor there was that the bow could only contain so many tubes, though - so extra tubes where stowed in strange locations, including the stern, or the upper deck, or the conning tower, and pointing whichever way.
Modern submarines only have bow tubes, though, since they can turn fast enough to cover most situations, and the torpedoes can turn fast enough to cover the rest. Or to be sure, the big oceangoing subs have amidships tubes, because the bow is reserved for the big sonar. It might make best sense to only give aft tubes to some of these subs - say, the ballistic missile ones - as torpedoes would only be fired at a chasing enemy anyway. But it might also make sense to give aft tubes to all subs, because that might help with forward angle stealth, and the direction in which the torps are launched would be irrelevant if the torps could maneuver.
And Trek torpedoes certainly can maneuver. We have seen them do tight corkscrews in TOS movies and in TNG at least.
Timo Saloniemi