Say I'm a home invader bent on burglarizing you. I've busted into your home, not knowing you were there. You wake up, grab your gun, and we spot each other in the living room.
I see that you have a gun in your hands. I am in your house. You have every right to defend your property from me with deadly force. You probably will, because you have a gun in your hands.
I am going to try to shoot you. I probably wouldn't have before. But now I need to.
If you have reasonable fear that you are going to be randomly targeted for murder, rape, maiming, or kidnapping, then it's reasonable to keep a gun for self-defense. But the most likely scenario is going to be the one I just described. And in that situation, as awful and unfair as it may be, you are endangering yourself by carrying a gun.
You are right that is unfair and awful. You are depending on the good nature of someone that has invaded your home! I'd rather go out with a fight than be subdued while they search the house and decided what to do with people that weren't expected to be in their own HOME.