The Salt Vampire and the Space Amoeba were threats to his ship. He really didn't have much of a choice.
How so? There's always the choice of giving up.
Indeed, several episodes across the shows featured our heroes claiming they had sworn to defend the ideals of the Federation with their lives if necessary. So, when the push comes to the shove, they don't have the guts to die?