Short answer: They don't really "turn 90 degrees". Or rather, they probably weren't supposed to.
In the fourth draft (the one just prior to filming) of the script, Lucas gives us a hint about how he envisioned the Proton Torpedoes working:
Your approach will not be easy. You
must maneuver straight in
down this shaft, level off in the
trench and skim the surface to this
point. The target is only two meters
across. It will take a very precise
hit at exactly ninety degrees to get
into the reactor system. And only a
direct hit will set up a chain
reaction. The shaft is ray shielded,
so you'll have to use proton torpedoes.
I think by "ninety degrees" that Lucas was probably imagining that the pilot had to be directly above the exhaust port in order for it to drop go all the way down into the reactor. That might make sense when you're writing something, but it's obviously harder to ignore the laws of inertia when someone asks you to animate it. (You may interpret it differently, though.)
The SFX team apparently took this problem and envisioned them more "realistically" as something akin to traditional bombs. You can see this in the movie for yourself in one of Dan O'Bannon's tactical displays:
It clearly shows the idea was that the pilot was supposed to "drop" the torpedoes into the exhaust port, like a real world bomb.
Later in the movie, when Luke actually fires his Proton Torpedoes into the Death Star, we see them shoot straight into the distance, and then "drop" into the exhaust vent. This implies some further input from Luke, but actually he turns off his targeting computer in order to manually decide when to fire his torpedoes into the exhaust port, and there doesn't appear to be any further input from him after that at all. Very confusing.
Indeed, if you slow down the infamous shot in question, you can see that the animator seemed want the torpedoes to appear to be falling... it's the just animation happens too quickly you don't see it. (And the previous shot of them travelling in a straight line, like a laser, doesn't really help.)
I created this animated GIF, slowing down all 16 frames of the animation, so you can see this for yourself:
So it appears to be a somewhat inconsistent interpretation born out of probably what was only a rough idea in the script to begin with (Lucas was never one for getting bogged down in technical details of his universe), rather than anything deliberately thought out.
Maybe George Lucas could fix this issue in one last "Special Edition"? :) (Just kidding, please don't kill me.)
Expanded Universe Explanation
Of course, that's just one canon. If you're open to letting other authors interpret how Proton Torpedoes work, and are prepared to enter the murky (and often contradictory) "Expanded Universe", then there's more answers waiting for you.
Noting their apparently strange behaviour in the original movie, it seems that most EU authors have imagined Proton Torpedoes to be simple homing missiles with the additional ability of manual remote control.
Here's some samples from the EU novels:
- X-Wing: Rogue Squadron (1996), Michael A. Stackpole
"Corran switched over to proton torpedo target control."
- Jedi Trial (2004), David Sherman and Dan Cragg
"Gunnery officer, mark that target for proton torpedo salvo. Deactivate the homing system. Use line-of-sight guidance system. I want these babies dead on."
In the games (X-Wing, Rogue Squadron, etc.), however, they are treated differently yet again: More like standard slow-but-powerful homing missiles, with no manual guidance. In the X-Wing Miniatures board game they are also treated like homing missiles (requiring a player to "lock" on a target before they can be fired). This is more likely born out of the need for gaming mechanics, however.
Despite this general consensus about their behaviour, other EU sources are contradictory. For example, the aforementioned Jedi Trial states that Proton Torpedoes were first used in the "Clones Wars", yet Anakin's big yellow Starfighter at the end of The Phantom Menace is said to be equipped with them. Furthermore, Star Wars: Knights of the Old Republic II, set thousands of years before the events of the movies, makes mention of them as well.
Basically, with the EU you pretty much get to choose your canon, but most of the time they're considered to be homing missiles, with the ability for manual guidance. (With this interpretation, Luke turning off his targeting computer allowed him to manually guide the missiles down the exhaust port.)