Castle doctrine stands for human or animal. If the animal is in my home or near my home and is a threat to me, my family or my property then if I cannot peacefully remove the threat it will be met with deadly force.
Genesis 1:26 New International Version (NIV)
26 Then God said, “Let us make mankind in our image, in our likeness, so that they may rule over the fish in the sea and the birds in the sky, over the livestock and all the wild animals, and over all the creatures that move along the ground.”
Insects can be poisonous, venomous, carries diseases, cause illnesses, damage your property like termites and can cause infestations of your home that are really hard and expensive to remove. Harmless bugs also attract other bugs that see them as a food source. So it is probably a good idea to remove them peacefully if realistically obtainable because every creature has a purpose in your ecosystem ( in less of course the bug doesn't belong in your regions ecosystem then they can cause great damage). But if peaceful means isnt realistically obtainable or puts you and others in harm's way then just remove the threat with a good ole shoe or fly swatter.