I just killed a few moths and feel terrible about it. It didn't even occur to me that I could've caught them and let them outside.
I do not swat flies. Even if they are buzzing around a room in loud, irritating manner, I figure the fly can be a tool for learning to be more patient and less bothered about such things. There is usually no purpose in killing them. Being irritated about their buzzing is not a purpose, that is simply something I should get over.
I would kill a fly if I thought they would contribute to a food safety issue, i.e. if they were landing on human feces somewhere. The woods-oriented Rainbows community takes some pretty serious and stringent precautions about such hazards. For instance, all food dishes have to be kept covered. Trench latrines (aka "shitters") are done in a particular manner, I think with lime available to throw in.
My basic belief is that killing should have a purpose. Whether we obey that moral code, probably has little Existential consequence, especially in the case of insects. However if gods existed anywhere in the universe, mightn't they regard your own life as akin to that of an insect? If you cannot treat a lower being with appropriate caution, why would you expect a higher being to give you any consideration? There may not be any higher beings anywhere in the universe, we might be at the top of the heap. But even still, as a model of how a higher being should behave, I say we should not kill without a purpose.
Moths do basically 2 destructive things in a household: infest food and chew holes in clothes.
The former isn't really an issue, strictly speaking it's extra protein. But if the aesthetics of moth eggs in your cereal bother you, it is easily handled. Keep things well sealed. Don't leave open cereal boxes, that's basically moth food.
The latter, well, I guess you don't want a big moth population in your house. Screens and food control should help with that. Some people use moth balls but other people have bad reactions to them. I'm not sure that killing individual moths would help with such a situation in any event. Rather, one would need to address the conditions that cause the problem.
Gratuitous insect management tip: fruit flies like to live in the slime under the rubber lip of your garbage disposal. Cleaning under there with something sufficiently effective, like something with bleach maybe ?, should solve that problem. And of course don't leave your fruit out in bowls to get bruised up and rot, they're called fruit flies for a reason.
Another gratuitous insect management tip: when ants have formed a line of invasion into your house, they are following a chemical trail. Any household cleaner applied to the trail, will destroy it. The ants may figure out another trail somewhere, or they may not at all. You don't have to start out with wiping out ants, you can start with wiping up their trails, and that may solve the problem.
I live out of my car. At one point, I was surprised to have a functioning ant colony underneath my car. It had been parked in my Mom's driveway long enough when I was visiting, that they had taken root there. I find ant colonies fascinating, especially the defensive behavior of rushing the pupae to safety when the top of the colony is exposed. Which in my case, was the simple act of opening the passenger door.
I couldn't bring myself to kill the colony. Individually I think the ants are cute, and collectively I find them quite interesting. I simply let them live in my car for awhile, thinking their colony couldn't survive indefinitely and the problem would eventually go away.
Sometimes they would tickle me in my sleep and that was irritating. Rarely they would bite me. I did kill some ants at times, depending on my mood about them. Sharing personal space with ants isn't the greatest, although in moderation it is doable. I was relieved when the colony finally died for some reason.
The ants had one beneficial effect. They tended to remove crumbs and other foreign organic matter from my car. Really good cleanup crew! I might hire 'em again for that.