There is a major difference between euthanizing a human person and euthanizing a pet. Traditionally people would say animals don’t have internal souls. I prefer to think that biblically speaking, God has given animals to us humans to govern and care for. In Genesis 2 especially, by asking Adam to name them, and have dominion over them, humans have been entrusted with the duty to master their lives as God would have them.
After the Flood, God further this authorization by allowing us to use animals as food, since it was on account of Noah that the animals were delivered from extinction by the Flood.
So, it is not immoral to kill or euthanize animals per se. However, the manner by which we put down a pet or slaughter an animal for food, does reflect the kind of person we are. If we are wasteful, or brutal, or abusive, or unmerciful in these actions, qualities that are contrary to God’s character, we would corrupt our soul and abuse the stewardship God has entrusted to us. Such abuse would cause disharmony in nature and separate ourselves from God; and if unrepented, it would be a serious sin.