I think Reddit's r/vegan explains the issues with eating eggs from pet chickens well. To summarize:
- Acquiring pet chickens is problematic because hen breeders kill male chicks (~50% of the chicks they hatch), since they can only sell females.
- Hens have been bread to lay an unhealthy number of eggs per year. Wild chickens lay 12 eggs per year, while domestic chickens lay 250. Laying so many eggs takes a lot of nutrients from the chickens, in particular calcium. Chickens can eat their own eggs to get back some of those nutrients, or they can be given birth control so they stop laying eggs.
- Hens stop laying many eggs after 1 to 2 years, but they can live up to 8 years. Many people kill their hens after they stop laying many eggs. Obviously, this is avoidable if you are responsible for the chickens.
- Eating eggs from backyard chickens can send the wrong message. It can indicate that you consider it okay to eat eggs from "humane" sources. However, even chickens at certified "humane" farms are still raised in terrible conditions.
I don't personally think all of these points are equally convincing, but some of them are strong enough that they'd prevent me from eating eggs from pet chickens.
From an environmental point of view, eggs from backyard chickens will be less efficiently produced than eggs from a factory farm, egg for egg, since they won't benefit an economy of scale. So if you don't eat factory farmed eggs for environmental reasons, it makes even less sense to eat eggs from backyard chickens.