Since firearms are lethal weapons, you can only be justified in using one on a person if you are justified in using it to kill. And, you are justified in using it to kill when that is the only reliable way to disable your attacker and protect yourself from imminent harm. Thus, if you use a firearm and your intent is only to wound, then you undermine your self-defense case, because it indicates that you yourself didn't believe lethal force was necessary. For proper self-defense with a lethal weapon, if the attacker survives, it should be only by accident that you didn't succeed in killing them and luckily gained enough time to escape regardless.
The implication of this is that if a non-lethal weapon were widely available and reliable enough to immediately disable an attacker, the legal basis for using lethal weapons in self-defense would start to disappear. The only reason firearms can still be used in self-defense is that we aren't to that point in non-lethal reliability.
EDIT: There may be a jurisdiction issue. In the US, at least, firearms are legally considered lethal weapons. Whether or not it's factual that "Disabling someone non-lethally is reasonably easy with a gun" (comment by Polygnome), this idea is not reflected in the doctrine of civilian self-defense. One must meet the requirements for use of deadly force just the same, even if death doesn't result. If the imminent threat does not justify killing, it does not justify shooting at all.
And practically speaking, trying to fire a gun at an attacker in an effective but non-lethal way -- even if it is possible with expert training -- is taking an unnecessary risk. Given that the situation has reached a point justifying deadly force, the goal for personal safety should be ending the threat as swiftly and certainly as possible.
The problem with "one should (or need to) use the least force necessary to defend yourself" in the other answer is that there is no situation where wounding with a firearm is valid self-defense but killing with a firearm is not. A non-fatal outcome is not legally "better" for the shooter but legally the same, when use of a firearm is allowed at all. (Of course, if the threat did not justify use of deadly force, then a non-fatal outcome may be legally better for the shooter: Being charged with assault or attempted murder is better than being charged with murder.)
An essay by a law professor makes some of these points:
If a less lethal means of defense is available, the use of deadly force is illegal. Firearms are by law deadly force.
A bullet...instantly disables only if it hits a couple of vulnerable spots, like the space between the eyes. A shot to the arm, the leg or even the torso may not stop an attacker.
Typically, a defender can lawfully use deadly force only to prevent death, rape, kidnapping or bodily injury serious enough to cause long-term loss or impairment of a body part or organ. But a nondeadly weapon can be used to defend against any threat of unlawful force.