First off one need know from where the idea of God comes. You see each animal life form has a base survival mechanism — impulse. A big part of this impulse is a need to live forever at all costs. Humankind has converted a part of this need to somehow live forever into the concept of God or Gods in some version of heaven and the multitude of religious doctrines that support this base impulse.
So if God is cruel it is because we — as God’s creators — are sometimes cruel.