Thomas Aquinas says two things that I think are relevant here. Firstly, that “God hates nothing he has made.” He doesn’t hate Adam and Eve despite their betrayal. He hates the sin they committed, but He allowed it to occur for reasons that can be explained by what Thomas says a few paragraphs later:
"Sin however has two outcomes: one is damnation, which it brings on itself; but the other is healing, attached to it in the plan of a merciful God who allows some to fall into sin in order that they may recognize it, be humbled and turn back to him. So the natural outcome of spiritual blindness is damnation; but by God’s mercy a temporary blindness can bring healing and eventual health of the blinded."
God didn’t preemptively punish them despite knowing what would happen. Firstly, because it would be contrary to justice, to punish someone for something they haven’t yet done. Secondly, because He wanted them (as He wants us) to “turn back to him.” He wanted to give them the opportunity to recognize their sin and seek forgiveness. I think it’s Scott Hahn who suggests that God asked Adam and Eve what they had done (despite having known it already) in order to invite them to seek forgiveness.
I hope this helps.