Most experts claim that insects do not feel pain the same way mammals or other animals do.
Although they do feel nociception, the sensory nervous system's response to stimuli that is considered harmful, this does not create the sensation of pain. The current definition of pain requires an emotional response, which insects do not seem to have. This puts insects in a category Also, insects naturally thrive when they are reared in a condensed area (this is a biological imperative for reproduction and growth phases), it is their natural inclination.
Therefore, there is no contradiction in farming insects and their natural way of being.