In some states in the US, you can just shoot home invaders. That is, the use of deadly force is appropriate for protecting one’s self and family from a home invasion, and there is no additional duty to retreat from your own home. It’s a shame that the people of Spain live with such little freedom that these bandits are able to basically force people out of their own house.
There is no state in the union where you can shoot people who are simply existing in your otherwise-unoccupied home, because "sleeping in a house you don't have permission to" is not an offense that requires any kind of violent defense. Even in castle-doctrine/stand-your-ground states where you don't have a duty to retreat, you still don't have a blank check to assault. Squatters are not home invaders, literally forcing people out of their own homes at gun point or some such. Otherwise, all a would-be murderer would need to do is plausibly lure their victim to their home, at some point say "I need you to leave", then shoot.
There's a million good arguments around American gun culture vs. European gun culture, but this is emphatically not one of them.