In the book Charlotte's Web, Wilbur the pig becomes good friends with Charlotte the spider. After the runt pig is nursed to health by a young girl named Fern, Wilbur is sold to Fern's uncle, who owns a farm. He is close by, so Fern will be able to visit.
According to dictionary.com, the definition of unjust is "not just." The definition of just is "guided by truth, reason, justice, and fairness."
In my opinion, using that definition, killing Wilbur would not be unjust. The Zuckermans own a farm. To them, livestock is a source of income as well as food. Their motivation for buying Wilbur was for their profit or benefit, not for emotional attachment as a pet. They could justify killing Wilbur because their motivation is guided by reason.
On the other hand, one might argue that killing Wilbur would be unfair, or at the very least unkind, to Fern. Since she is family and she is so attached to the animal, her views are very clear. One would expect the Zuckermans to take her views into account.