Insects or Insecta (from Latin insectum) are hexapod invertebrates and the largest group within the arthropod phylum. Definitions and circumscriptions vary; usually, insects comprise a class within the Arthropoda. As used here, the term Insecta is synonymous with Ectognatha.
Killing harmful insects is allowed. If the insects can cause serious illness to you or your children or any one at your home, it might be necessary to clean your house from such harmful insects.
It is allowed to kill insects posing harm to us.
It is not true to say that every locust is Halal to eat. Locusts which die in the water or on the earth are not Halal at all. The Hadeeth from Ali Ibn Jafar, the brother of Imam Musa Ibn Jafar (AS): I asked Abul Hasan (AS) (Imam Musa Ibn Jafar): About the locusts found dead in the water or in the desert, can it be eaten? Imam said: Do not eat it. (Wasaa'il Al-Shia, Hadeeth number 30067).
Only locusts which are taken alive then die are Halal (Hadeeth number 30068 in Wasaa'il Al-Shia).
The people in Arabia used to eat all types of locusts and many of them still eat it, but Islam forbade eating the dead locusts and the small locusts as well till it Fly.
Usually, non Arab Muslims do not eat and even do not like the idea of eating locusts, while many Arabs specially those wo live in the desert, do.
It is not necessary for the Imam (AS) himself to eat every thing which is allowed to eat or to do every thing which allowed to do. Imam (AS) is the Best and Most humble servant of Allah (SWT) and he does only the best deeds and not every deed which is allowed for general public who have their their own needs and circumstances.
There is no sin in killing harmful insects to avoid its harm on you or your crops.