I realise that Microsoft wanted a way to show off their GUI, however what in particular made them pick Solitaire over another card game? Was solitaire already popular at that point? Or was it quite obscure?
The story of Solitaire on Microsoft Windows actually starts rather earlier, back in the fall of 1979. The student Brodie Lockard, a gymnast for Stanford, had an injury during practice on a trampoline, landing on his neck and damaging his spinal cord. He became paralyzed from the neck down permanently at the age of 19.
While in the hospital, he was able to use a pen in his mouth to draw pictures (his first being of a boy in a wheelchair); relatedly, he later requested a PLATO terminal.
PLATO was, essentially, a networked system far ahead of its time, a full graphical system from 1960 with touch screens, and the spawning point for the world's first CRPGs and first-person shooters. It spawned from the University of Illinois, but, significantly, had a foothold in Stanford by the time Lockard was a student. He was able to get a special hookup for his long-term stay in a hospital that he could manipulate with an electronic pen.
During this time he made a solitaire mahjong game that involved placing all the mahjong tiles in a pile and matching them. An early version was sold commercially for PLATO, but that was of course a limited platform; he eventually managed to get a contract with Activision to eventually have his game sold starting in 1986. It sold an enormous number of copies, and spawned endless sequels while essentially inventing the "casual game" category for computers.
A year later, Lockard worked on another project, this time as a programmer. The game was designed by Brad Fregger and Software Resources International, and published by Spectrum Holobyte. It was the first computer solitaire game, and included Klondike (having been popular all the way through the 20th century) as well as other solitaire games like Pyramid and Golf. Lockard's contribution was the Macintosh port (Michael Sandige did a PC version).
Significantly, the Mac version was later seen by Microsoft intern Wes Cherry, who did a version for Windows as an exercise. (According to this interview with him, he never made any money off of it.) Windows had already included a game since version 1.0 (Reversi) and the intern's program seemed worthy of inclusion in version 3.0 which came out in 1990; according to the project manager Libby Duzan speaking in 1994, this was to "soothe people intimidated by the operating system" while simultaneously teaching them how to use the mouse.
Now, the popularity of Solitaire was immediate, so -- according to Brad Fregger, who created the original Solitaire Royale -- he was approached to have his company develop a new full-featured version for Windows 3.0. His company worked on the development but while the project was in progress, a new Director of the games division came in and pitched the contract without even notifying the original company. (Software Resources International almost went bankrupt, but the game was picked up and published by Interplay.)
Note this all comes solely from Fregger; I haven't seen absolute verification of the contract, but there's no reason I've found to doubt his testimony here. It's true that another card game came to prominence for Windows not long after, also published by Microsoft, also developed first on PLATO (all the way back in 1978 by Paul Alfille): that of Freecell. While Klondike was popular before it made it to computer form, Freecell's fame was caused by it.
...
More on early CRPGs can be found in Matt Barton's Dungeons and Desktops from 2008 published by CRC Press, although I should give warning some of the research is now seriously dated; this blog post gives a pretty good update. Oubilette in particular directly spawned Wizardry, which directly spawned the Japanese RPG industry.
More about Brodie Lockhard's injury (and a picture of him doing gymnastics) can be found at this Stanford Daily story.
Alex Smith (whose book They Create Worlds: The Story of the People and Companies That Shaped the Video Game Industry, Vol. I: 1971-1982 comes highly recommended, although I didn't use it for this answer) has a podcast episode specifically about the history of casual games including much more detail on the deal with Activision for Shanghai: A Casual World Part 1.
Fregger's story of solitaire is from his own webpage (the actual title is "OPEN LETTER TO BILL GATES: Robber Baron of the Computer Age" so he's clearly still bitter about it).
...
Dear, B. (2017). The Friendly Orange Glow: The Untold Story of the PLATO System and the Dawn of Cyberculture. United States: Pantheon Books.
Garreau, J. (1994 March 9). Office Minefield. The Washington Post.