My second question on MY contains a lot of relevance to this question. I did my own research and answered that question. I will base what I write here with those source and that conclusion so therefore I won't be re-quoting the sources.
It's a good question - how can anything go against Hashem's will? How can sin be even possible? This is a deep question that is asked in Jewish Hashkafa, and the answer I find the clearest comes from Chassidus.
Will has an inner and an outer aspect. It is my outer will that my children behave at all times and never fight, steal, break things, talk back etc. However, that's not my inner will. My inner will is that they become actually good on the inside and own that goodness themselves. So when raising them, I have two choices. Either I could always get my way, and nip any infraction in the bud immediately, create an atmosphere of intense, terrible discipline in my home and force them to engage in acts of goodness all day. In that scenario, I'd never have anything that I want violated at all (how pleasant that would be for me!). Yet, in that case I wouldn't get what I really want: good kids.
L'havdil this is similar to Hashem's relationship with us. Hashem has taken it to an amazing extreme: He has given us completely free reign to violate His will. His goal is to produce good people who own their good (see Derech Hashem 1:2:2) to the greatest degree possible.
Chassidus (as well as many other strands of thought) add that in the end, Hashem always gets what He wants - there is only One Will, and none other! We have the ability to mess up plenty, but Hashem tidies up after us along the way. Therefore while it is possible for us to produce a mamzer, Hashem will still make sure that in the end everything works out through hashgacha. Hashem's outer will may be violated, but His inner will is never violated, so everything that happens, even sins and evil, are always exactly what He wants in exactly the way He wants.
He didn't want one to have this mamzer (see the Rambam quoted in the linked answer), and didn't "predestine" it. But He did want us to have that choice, and when we made it He wanted us to experience the consequences, learn from it, partner with Him in creation and find the good in it. He did foresee it before creation and therefore arranged for the right soul to be in the right place at the right time, as well as a billion other details to ensure that everything still goes according to His inner will all along the way, and by the end of the project, He gets what He wants, what is best, what is good.
As I explained in that answer, does that mean we don't have to worry? On the contrary, expecting the supreme King of Kings of Kings to tidy up after us like a janitor; ruining the way things could have been had we stuck to His outer will; fill His and our story with unnecessary tragedy and terror due to our arrogance and selfishness - all of that is on us. This world is serious and real and forever and there's no going back. It's important, worth caring for infinitely, and Someone does indeed care for it infinitely. Facing the reality of that is going to be a very dreaded day indeed and we can only pray that Hashem will wipe away ours and His tears speedily.