As much as I find chickens, and all avians in general, cute and I find it sickening the way they are treated... I do love eggs, they're tasty, versatile, easy to cook, and unbelievably healthy.
I think the differential we have to identify is one thing, and that is scale.
I am not a vegan, I do not believe it is wrong to consume animals or animal-sourced products, however I do support animal welfare and believe that if we are to raise livestock for consumption they should be treated as the sentient, thinking, feeling creatures that they are and cared for accordingly.
Imagine instead of human and animal rights we just had "sentient rights", for example.
Being able to test for sentience is a topic in and of itself, and out of scope for my argument.
I think there is no harm done in, a hypothetical world where people had the space to do such a thing, raising our own livestock, limited to individual homesteads or the immediate settlement (a local town market, for example).
The line where it becomes unethical is quite obvious really, are the animals treated as living things, or machines to simply fuel and feed to grow them for slaughter and harvest? Yes, in my example of fair treatment the goal may be to raise them for eventual slaughter, but its their lifelong treatment where this applies, not the overall objective.