Farm eggs (as opposed to factory eggs) require humans to collect them.
That is straight up the single most extensive source of cost that makes factory produced eggs win in the market. Factory produced eggs do not need a human to collect the eggs, because the chicken is forcibly held in a confined space over the egg collection machinery, and even primitive machine vision systems can determine if the chicken has laid an egg, and then initiate egg collection.
The second, is that cost of premises is much lower when it does not have to allow the chickens to wander around, get in and out of the building to graze/eat bugs, etc..
It's all about the economic maxim of "Maximal product output with minimized costs to production."
This is the kind of thing that regulation is for, since without those regulations, atrocities are inevitable. History has shown this repeatedly, and even abuses against humans are not uncommon. (See all those rug factories with children that end up with wrecked lungs.) "It's just business" is perhaps the singly most malign thing anyone can say in this century.
My answer is that regulation is a thing, it is a thing that needs to exist, and it should be utilized. Correct utilization will fix most if not all of these ethical conundrums.
(that is to say, I feel the ethical vegetarians should spend less time trying to food-shame omnivores, and spend more time roasting laissez-faire capitalists. The issue is much less "the food itself", and much more "the means by which it is produced.")