Every flying swarming thing is unclean to you… (Deuteronomy 14:19)
Certain species of locusts are kosher; beyond that one may not eat any non-kosher locusts, nor any flying insects (all of which are non-kosher).
Way back in Mitzvah #157, the Torah prohibited certain species of birds as non-kosher. The result is that everything else that flies would be considered kosher. Therefore, the Torah comes along here and specifically prohibits us from eating flying insects.
The reason for this mitzvah is what we said back in Mitzvah #73: the human body is essentially a vehicle for the soul and the Torah is the user’s manual for taking care of the equipment. God has instructed us what not to put in the body because it is harmful to the soul.
This mitzvah applies in all times and places. It is discussed in the Talmud in tractate Chulin on pages 65a-66a and is codified in the Shulchan Aruch in Yoreh Deah 84. This mitzvah is #175 of the 365 negative mitzvos in the Rambam’s Sefer HaMitzvos and #96 of the 194 negative mitzvos that can be observed today as listed in the Sefer HaMitzvos HaKatzar of the Chofetz Chaim.