We specifically discussed this in a biblical analysis class I took. God was making Ramses act like that to prove a point about what would happen if people crossed him or his chosen people. My professor was candid with us that the perception of God in those times was very different from how the writers of the new testament viewed him. He wasn't supposed to be kind of loving, he was just the being who was in charge of anything. He acted more as a force of nature than an objectively moral deity.
I recall ancient Hebrew theology being very grim, and not just because of OT God's constant malevolence (IE, ruining Job's life and killing his innocent family members in order to prove a point to the satan (not "Satan" as we think of him; in the old testament, "the satan" was an antagonist role that could be fufilled by different characters, such as the snake in Genesis). There was this general belief among the Hebrews that bad things constantly happened in their lives (often due to God being displeased with them) and they would just have to live with it. There was only one afterlife to them, called "Sheol." It was a dark, desolate pit that all souls went to where they would be deprived of God's light. Your existence was essentially negated unless you produced children to carry on your lineage. Considering the Hebrews were constantly getting enslaved, conquered, and mistreated by every other nation in the area, I suppose their negative outlook made sense.
In the middle ages, there was a gnostic-inspired sect called the Cathars in southern France. They believed that OT God and NT God were completely different entities. OT God was the evil god who created the physical world (where our spirits are trapped in these fleshy forms), whereas NT was the benevolent deity who ruled over the spiritual realm and had humanity's best interests in mind. I remember reading about that and being surprised at how reasonable it seemed to me.