It seems less cruel for an animal to spend its life standing in a field than for it to be stuck laying eggs its whole life or being milked twice a day for as long as its useful, only to be led to the slaughterhouse. In fact, commercial chickens are the most cruel industry, chickens are so cheap they are treated like a bulk good, rather than like a living animal. Even free range chickens live a shit life.
We talk about treating our servers like cattle, rather than pets. But cattle are actually treated very well, there's a lot of value in a single beast and it's worth looking after them when they're sick. Chickens are so cheap (they cost, what, $7 at the supermarket?) that if they're sick or injured, it's cheaper just to turn them into fertiliser.
Of course, that's just the commercial industry. Home raised laying hens tend to live a comfortable life.