One of my favorite Torahs of all time; for a good healthy perspective on life.
Pirkey Avos ch 5.
"The world was created with ten utterances. What is this teaching us? Certainly, it could have been created with a single utterance. However, this is in order to make the wicked accountable for destroying a world that was created with ten utterances, and to reward the righteous for sustaining a world that was created with ten utterances."
It's a basic essential principle that Hashem is the essence of goodness.. "G-d's kindness is all day", "the world is built with kindness", "G-d with his goodness, every day and moment, renews creation"... Etc.
So here is our loving and kind G-d deciding to make a world, and he was so mad at people that didn't even exist yet so the 'very 1st thing on His mind', before even the tzadikim, is beating up reshoyim!?
He don't sound too nice to me..
Anyone who's learned the laws, and seforim on monetary damages and payments, knows that "to collect payment" in loshen kodesh is "l'purah" .
Interestingly, this mishna uses the same word for what Hashem wants from the reshayim: l'hi'purah... "To cause them to give payment" (it does not at all say to punish them)
What in G-d's name could a Rasha possibly have that is so precious (even before tzadikim), that makes G-d pursue him 1st to get him to "pay it back" to G-d??
Teshuva.
We were intentionally created imperfect; with a strong inclination to sin, and the wonderful ability to do teshuva! The greatest nachas above, yes even higher than the avodas ha'tzadikim, is from our teshuva.
Indeed the very 1st thing which motivated Him to have a world, was having imperfect, struggling people (like us) and an imperfect world, as the major ingredients in His plan. Watching us grow, striving to repair ourselves together with our portion in the world around us, causes unimaginable heavenly delight above.
Only those of us who know VERY WELL the 'taste of sin', can understand what it means to 'destroy, in a miraculous way, a (normal) world that was created with 10 utterances' ('10' is the way the world is arranged 'according to plan').
The ba'al teshuva is the one who learns to 'break through' the normal patterns of connecting to Hashem and 'squeeze' extra energy and resources out of himself to re-connect to kedusha.
"Zedonos na'aseh l'zochious!" (Intentional sins actually become merits!! We gather MORE merits than the 'normal' pattern)
For sure the straight and narrow 'good guys', the tzadikim, aren't off course in anything. They are "sustaining a world that was created with ten utterances", and keeping things "according to plan". With time, we also learn how to function again in this world 'according to plan.'
Inevitably however, in select moments throughout any day, we blessed ones have the gift(!) of feeling: "what I see is not enough".."My heart needs more Hashem". We make an extra call, do an extra good deed, spread an extra smile, and happily lend an extra hand to someone in need. We have an inner 'necessity' for a deeper connection, and we are 'always' (sometimes more, sometimes less) motivated us to break the normal run of the mill pattern, thereby destroying "the normal' world that was created with ten utterances."
So our 'sinning' was indeed 'part of the plan' to begin with, so that Hashem would have our Teshuva after.