Yes certainly, there is bad karma for killing any living beings that has consciousness. They suffer pain, and all animals are naturally fearful of death (tan1 sheng1 pa4 si3). When you try to kill harm them, they run away for their lives. In Buddhism, loving kindness and compassion are very important qualities. Therefore a true Buddhist avoid killing even the smallest animals.
But there are wiser ways to get rid of pests.
I posted in the forum more than one year ago:
Hello, my master Ven. Shen Kai offered a solution to Ants and #^@$roaches. He also mentioned about mosquitoes (but I can't remember well for that one). I will summarise a few points below.
Ants - put some Mei2 You2 near their home, they dislike the Mei2 You2 and will definitely move away from their home to somewhere else. To give the ants a sense of direction where to go you may put some food nearby, and they will go and live there. But don't put the food too far as it may be difficult for them to travel that far distance.
#^@$roach - get some empty Wu3 Jia1 Pi2 Jiu3 (a type of Chinese traditional beer?). #^@$roaches love to have a beer and will all go inside. Then you can throw the cans into a dirty place i.e trash can and let them live in their paradise. I don't know about other beers, you all could experiment yourself.
Mosquitoes - I can remember only he mentioend two ways - burning that mosquito 'incense', or using some kind of electronic device that could make them sterilised and not be able to reproduce babies.
So we do not necessarily need to kill them to get rid of the pests. Wisdom will be of good use.
My Master taught - to develope Great Compassion one must start by not harming, and protecting animals no matter how tiny they are.
Even though these animals may be tiny - if you can kill small animals, one day you might kill bigger animals, then killing humans no longer seem a difficult task to do.
Namelessness:
I was taught that if we truly accomplish non-duality, we would be in one with everything. Certainly, we would not be bothered by anything because everything is us and therefore we won't kill ourselves.
But it is hard to get there for ourselves, not to mention our family members. So far what I can do now is to communicate with those animals and tell them not to bother my family. Because my family still kill them without mercy once they appear in the house. I just warn those animals in my mind that if they ever come into the house again, they would be terminated.
So far it works very well for %^@#roaches. But we can still find one or two %^@#roaches crawling in the house per year, especially young ones. Perhaps they didnÂ’t hear me or warned by their parents. 