I don't know the reason but I suspect it was a result of military tactical changes that occurred around 1890-1910 and the way infantrymen fired the rifles. A straight stock is the best configuration for making quick shots while standing, kneeling, or on horseback. But a stock with a pistol grip is the best for shooting from sitting or prone. Try it out with a couple of guns and you will see for yourself.
Military usage has always driven weapons design. Cordite and nitro on the battlefield initiated the decline of black powder sporting guns and led to the standardization of nitro burning rifles and shotguns for all applications. A million young men returned home to their various countries after WWI with the taste for a bolt action rifle and the golden age of bolt guns followed. GIs came home from WWII where they had been using Garands, M1 Carbines, BARs, Thompsons, and Grease Guns and the demand was so high for semi-auto sporting guns that several new designs of rifles and shotguns appeared and sold off the shelves.
The latest revolution/evolution as a result of military changes is the transition of the "black rifles", into the sporting arena. This of course is due to demand created by young service members returning from the last ten year's activities in the middle east. The gun industry is seeing a birth of new manufacturers like the US has never seen before. Companies like Rock River Arms, Delton, Bushmaster, Anderson Manufacturing, Sabre Defense, Stag Arms, Sun Devil, SOG Armory, LMY and BCM have joined the old standbys AR15 makers of Colt, Armalite, and Olympic Arms. And who would have guessed that we would see ARs from Smith & Wesson, Ruger, and Remington manufactured and marketed for sporting use?
Similarly, I suspect the transition from straight grip to pistol grip was just the result of changes in military firearms to make them more suitable for shooting from a prone position. Nevertheless, it's just a guess.