The question I will try to answer is:
Can anyone please offer any explanation as to how a totally-good God can create evil deliberately and still remain holy and righteous?
I will attempt to explain this from the point of Original Sin. This is becuse I myself struggled to understand this for some time and found that this can be explained better from that point of time.
It is difficult to understand the mind of God and we as humans are definetly far short of knowing His wisdom. Over the time, God has made himself known to mankind in various ways and but it is through Jesus that He demostrated His Kindness and His love towards His creation.
From the very beginning, man held a special and unique place in God’s creation as he was created "in the image of God". In his own nature, man unites the spiritual and material worlds.
God’s gift of free will.
God created Adam and Eve with unique characteristics called free will and gave them a choice: to obey Him or disobey Him which is same as choosing good or evil.
God is a personal being and the greatest passion of personal beings is the desire for personal relationships with other personal beings. Therefore, God, as a personal being, created us in such a way that He could have a meaningful, personal, and loving relationship with us. Nevertheless, this had a severe price.
I cannot experience love from you unless you have the capacity to do otherwise. If you have the capacity to, not to love me, and you choose instead to love me, then that choice has validity and meaning. You cannot have a love relationship with a computer. It is pre-programmed to serve you. Without that choice, man would have been like puppets, able to do only what God wanted.
God therefore wanted to demonstrate his glory through humans, which had their own free will. When he receives the glory and obedience from humans in spite of having with them the free will, it is an immense satisfaction for Him. God expects that his most important creature would give greater glory to Him by remaining obedient, in spite of having free will with them.
But why God created evil?
God did not create evil as nothing evil can come from good God. Satan and other demons were at first good angels, created by God, but they became evil by their own doing. This "fall" also came from the free choice of these created spirits, who radically and irrevocably rejected God and his reign. Their aspiration was to become like God, which is reflected in the tempter's words to our first parents: "You will be like God." It is the irrevocable character of their choice, and not a defect in the infinite divine mercy that makes the angels' sin unforgivable. So we see that evil is a side effect of existence of free will and choice.
There is no repentance for the angels after their fall, just as there is no repentance for men after death.
The power of Satan is, nonetheless, not infinite. He is only a creature, powerful from the fact that he is pure spirit, but still a creature. He cannot prevent the building up of God's reign. Although Satan may act in the world out of hatred for God and his kingdom in Christ Jesus, and although his action may cause grave injuries - of a spiritual nature and, indirectly, even of a physical nature - to each man and to society, the action is permitted by divine providence which with strength and gentleness guides human and cosmic history. It is a great mystery that providence should permit diabolical activity, but "we know that in everything, God works for good with those who love him."
Why then did God do this when he knew in advance that the result of free will and evil would be so disastrous?
Many questions comes to mind at this stage. Questions like Did this God of love not care that war, murder, rape and so much senseless violence would be the result of his choice to give us free will?"
Why an all-powerful God did not eliminate evil? Since the implication is that the removal of all evil would permit a better, more loving world.
A truly loving God, would have desired and created such a world because it is clearly superior to the one we have.
Any God that did not follow this logic was not a God of love, but an evil tyrant.
Answer is bit difficule as I have mentioned at the begining as we do not have the intellect to understand the almighty God. But a simple story I read comes close to explaining this mystery:
Suppose a mother had three children and one of them died. If you could go back to the time before she had any children, with the knowledge that one of them would die this horrible death, would she attempt to have children?"
A mother would definitely say yes. Because, the love and the joy and the happiness that parents received from their children, far outweighs the pain, suffering and misery they experienced from the loss of that one child.
In this there is an incredible insight as to why God allows free will and evil to exist. A loving God can allow an evil state of affairs to exist, since in allowing it to occur, it brings about an even better state of affairs.
Because He is outside time and knows all things, He knew that there would be tremendous pain and suffering as a result of His decision to create a people with the capacity of choice and, consequently, the capacity to sin.
But God, like this mother, knew that the love He and his human creatures would experience, would outweigh the pain and suffering that would result from His decision to create us as He did. The consequences of God's decision were not unforeseen. They were foreknown!
The moment evil is taken out from this world you also remove the choice from the nature of human. The existence of evil is the "side effect" of creating a world with a thirst for love.
A world possessing both evil and love, is far superior to a world where neither is possible. For God to eliminate evil, He would have to eliminate our capacity of choice and thus our capacity to do both evil and good. And such a world is inferior to the one we have: one where love is possible, despite its inherent evil. What kind of God would do this? Only one kind. A God of love.
On the other hand, there is another question. Is God a "limiting God" and not omnipotent?
This is based on flawed logic. It's the same logic flaw atheists use when they say, "If God can do anything, can He create a rock so heavy He can't lift it?" There are logical impossibilities and there are things God cannot do. (Lie, be wrong, learn, sin)
Finally, we come to the first instance of Adam’s disobedience to His creator. What is The tree of the knowledge, and why does God put it in the garden?
It seems like putting your children in the backyard to play and saying, "By the way, don't jump in the pit with the spikes lining the bottom that I dug in the back corner by the swing set, okay?"
God was giving a simple message to man: "Evil" is the things that you're not supposed to do, "good" is the things that you should do. The only thing you need to know about "evil" is don't eat from that tree.
Adam was in the state of original holiness whence he was not able to differentiate between good and evil for he was yet to eat the fruit from the forbidden tree. Adam is not able to differentiate between good and evil for his nature was such that he was not in a position to recognise the difference. It is like a computer, which is unable to recognise a PDF format of a file unless an adobe reader is installed on it. The computer knows that PDF file exists but will not execute it, because it does not have that capacity to recognise it. Adam knew that evil exists but he is neither able to recognise it nor he was able to execute it. Under these circumstances, neither God wants that Adam should know about the good and evil by forbidding him from eating that fruit and continue in his present state.
For this, he has to only obey God’s commandment not to eat from the forbidden tree. But here also there is a glitch, because there was no way Adam could exercise his free will, in absence of his knowledge about good and evil and show his obedience to God. The only way God could know the obedience of Adam was to tell Adam not to eat from this tree, which would allow Him to know the free will choice of Adam about his obedience to Him.
As a consequence of free will, God kept the CD containing the programme “Adobe Reader” (tree of knowledge) in the garden which will enable Adam to recognise the PDF file format (good and evil) and also allow him to execute the file with PDF extension. There are two aspects here. First – till the time Adam obeys God’s command and do not eat from this tree, he will exercise his free will and be obedient to God. Till that time this programme was not installed on Adam, he would not be able to read and execute this file (evil). The moment Adam disobeys God, Adam will exercise his free will and this programme will be installed on Adam and will recognise the good and evil as well as able to execute it (evil) also.
Before the fall, they were having a nature that made them to do only the good and the power to do evil was beyond their area of understanding. This understanding and the change of their nature would come only when they disobey God and eat the fruit from forbidden tree. With this, one obedience Adam was supposed to live a life doing everything good and not knowing or doing evil. The obedience would have kept him barricaded from being dying.
Sources: Many and few of them are
PS. My apologies for this answer being so lenghty but I could not make it any more shorter, though I tried.