Abortion is the taking of a life that has not yet had the chance to do anything, good or bad.
Death Penalty is the taking of the life of someone who has chosen to do evil, and thus sacrificed their chance at life.
Self-defense killing is the legal taking of a life that has attempted to take your property by threatening your life, attempted (attempting) to take yours (or someone else's) life, or is attempting to cause you (or another) great bodily harm.
Gun rights are not about any of this however. The 2nd amendment to the Constitution is about an armed citizenry being the last defense against a tyrannical government.
There is no inconsistency.