Jesus was foreknown as the perfect, blemish-free sacrifice before the foundation of the world (1 Pet. 1:20). Jesus was also the logos of God that was with God in the beginning who was God. His incarnation is, therefore, not a contingency. He was always going to come into the world and die and resurrect and ascend whether anyone sinned or not. To say otherwise is to say his existence in the world, his "foreknown-ness" is dependent upon the existence of sin. This is hugely problematic form many reasons (beginning with the Creator being dependent upon both the creature and His creation). Any Christology to the tree of life in Eden makes this apparent because the tree existed prior to humanity and it and its blessings/benefits existed whether Adam and Eve were sinless or sinful, obedient or disobedient.
Whatever the reason in His creating Man, it had nothing to do with sin, or at least was not predicated solely on sin's occurrence.
The better way to understand creation is that God has a purpose(s) that will be concluded as He see fit and His purpose already addresses the event of sin and its subsequent corruption.
As far as Calvinist doctrine goes, God ordained everything from creation but was not the author of sin, and He did no violence to the human will or the contingency of secondary causes when He ordained those "all things." Therefore His "damnation of the race" is not an afterthought. Neither was it a determinism that violated human will. Neither was it a determinism that violated already-existing causations (primary or secondary). At least these are the necessities to which any and all Calvinists must adhere if they are going to be consistent with their own doctrine(s). Adam knew he'd die if he disobeyed God. God had not damned Adam personally prior to Adam's disobedience but God had already decided all the disobedient (whoever they may be) would be damned and He had designed that into creation as an inescapable inevitability. God did know Adam would sin and thereby relegate himself and all his progeny to the consequence of sin (which is damnation).
Disappointing, but not a problem for why God created man. The Creator is above that kind of dependency. Adam's disobedience did not change the eternal purpose of God one smidgen of an iota.
So that some men (and women) be those who would be born of God, based on His first born. His foreknowing Christ is extra-hamartiological. His knowledge of Adam's inevitable sin and His designing the consequences thereof was all already covered by 1 Peter 1:20. Adam's disobedience is disappointing, but not a problem for which God has to have another plan. His original plan already covered it all.