Defence of others is indeed covered in self defence. But the threat response has to be proportional -- you can't shoot someone in the head because they look menacing or said you had an ugly dog.
The 'castle doctrine' you refer to is a perversion peculiar to some US states, but it still has to be your home and you still have to have a reasonable belief your life is threatened. Strangely, although you can use lethal force on an intruder/trespasser, if you shoot a police officer about to conduct a lawful no-knock raid, I think you could get convicted.
"Lawful no-knock raid" is a basic contradiction. If there is no notice that the home invaders are police, then they're actually just home invaders. It's unfortunate that so many will have to die before a sympathetic enough casualty comes along to end the practice.
It is certainly the case that, statistically, no-knock raids are unjustified. The idea that losing a dime bag of drug evidence is sufficient basis seems absurd. If it's a Hell's Angels clubhouse full of weapons or a Sinaloa cartel abduction site I can see the necessity, i.e. to reduce the risk to the community of high powered weapons use by the suspects. But judges in the US see to give out no-knock warrants like candy.