Moral Values Of Islam
The moral code is defined for human beings, not for God. God gives death to people and other living beings in so many ways. He has allowed to sacrifice animals. He asked Muslims to do jihad and give their life in His way. So if has asked for the sacrifice of Ishmael, He has the authority to do do. However, it was not demand to sacrifice Ishmael. It was sign to indicate that Ishmael should be dedicated to the service of Kaabah. Hazrat Ibrahim did not interpret the dream and tried to fulfill it as it is. For details see the explanatory notes in Albayan by Ghamidi saheb.
Please refer to the following video https://youtu.be/KPR-hzoROaw?si=0acAzCr5WsFjVQkA