It’s a question a lot of people have, and one that Christians should be read to address. After being asked about it for a documentary, Justin Taylor takes a crack at responding to that question here. Just a taste:
As I mentioned, many missteps in theology are on account of the implicit idea that God must act as we would act. It is common among some to appeal to the image of God, our sense of moral intuition, and Jesus as the ultimate revelation of God to advance the idea that if we wouldn’t act in a certain way, then we know that God cannot act this way and remain righteous.
But I think that is inverting the proper Creator-creature relationship.