We call God God because He made everything, and so He owns everything.
Murder is wrong for us because we don’t own life, not someone else’s life, not even our own life. We have no rights to take life because we can neither create it nor restore it. It is cruel for us to take life because we rob what is not ours, and we disrupt God’s plan for this person.
God, on the other hand, not only created all life, but He is life itself. All life is His and is in fact His very presence in every created thing. He absolutely has the right to give and take life as and when He pleases. And since He is the author of each person’s plan, He does not take life out of cruelty, but if He does take life willfully, it is because of something greater in His Plan.
And since life is God’s, He alone knows what happens to each person whose life He takes back. He alone can provide eternal life. For Him, taking a life from this life is not the end, but a transition to the next. He therefore can make good what seems evil in death.