Pretty early on in our campaign I put this option to my players: You can pick the difficulty for breaking into starships at any difficulty you like, but it will also apply to your own ship. Suddenly starships became all but thief-proof.
It's pretty straightforward, really. If the PCs derail the campaign by stealing starships from NPCs, have NPCs steal their ship a few times. Preferably with all their good gear inside it. If the PCs love jumping into their starship to shoot at the poor NPCs, have the NPCs get reinforcements in the form of several souped-up freighters or a few starfighters. Any situation in which your players will have access to a starship, there's no reason why the NPCs won't have access to one as well.