I don't generally think warning shots are a good idea in most situations. However, they have been shown to work in numerous situation as well. So the idea isn't completely without merit.
There are a several good reasons for warning shots;
1. Jury perceptions.
In criminal trials perceptions and beliefs of members of the jury going into the trial is very important. In fact many cases are won or lost in the jury selection process. I have served on a jury and, frankly, it was scary how some jury members think. Question like "why didn't he just shoot the gun out of his hand or just shoot him in the leg" during jury deliberations are not uncommon.
2. Race.
Ugly but true reality of America. I know white LEO's that have said they will not shoot a young minority as it is not worth the risk of losing their job and/or being charged with a crime and enduring the court case.
You don't have to look very far for cases involving a white LEO or white citizen shooting young minorities that resulted in civil unrest such as riots or criminal charges.
3. Use of Force Continuum.
Adds another step before using deadly force. Verbal commands (Stop, drop you weapon), retreating from the threat, less than lethal force (pepper mace, unarmed physical defense), display of force (draw your gun), firing warning shot of if can be done safely before actually shooting the attacker.
4. Mental / physical condition of attacker.
Drugs and alcohol play a important role in how a person reacts. Responses by a impaired person is much slower than a normal person.
5. Media.
Remember T.V. and Print media is not on the side of the gun owner. They are not our friend and will alter the facts to fit their anti-gun agenda. Having your face on T.V. when the victims family is talking about how he was kind and caring without a mean bone in his body, how he was in the process of getting his life together, was going to go back to school, get a real job to support his children from other women and was going to marry his pregnant girlfriend is not a good thing.