Tony,
The expansion of the rail network from around 1850 - 1900 was critical to the formation of many a club in Scotland and the UK in general. Many on here, when it comes to GCA, can't see past all the top courses (TOC, Prestwick, Muirfield, Sandwich, Royal Liverpool etc...) but the case for the smaller and less affluent golf clubs is all too often understated.
The so called boom in golf during the 1890's in particular, included hundreds of small villages all over the UK who saw golf, not only as a personal leisure activity promoting greater health - but also a boon for their tourism interests !
The railways had created affordable travel for almost everybody in the country, and these people were itching get out and about.
Usually, the first thing that was assessed was the viability of setting up and forming a club, finding suitable land, and laying out the course. Sometimes a course would be deemed fit for play in a matter of a few months (no manicuism required in those days). Another factor which was highly important, was that of the local train "station"? The course would be placed at a convenient distance from the station - if they had one ! If not, they would petition the various rail companies to rectify the matter. This was not always successful with expense being prohibitive where they might have required a bridge to cross a river etc..
Villages became tourist resorts thanks to the railways. Houses would be let out in the summer months with whole families living in their attics to accomodate the visitors. Attractions were neccessary to keep the customers active and happy so bowling greens, public parks, and essentially the local golf course was a must ! Any town or village in Scotland by 1910 which didn't have it's own golf course was regarded "an old world place !"
Tom MacWood makes relevant points and to add to his I'll say that ill health was to act as a spur for the popularity of golf ! The consequences of the industrial revolution had played havoc with the nation's health, especially those in the urban areas. TB was still a killer ! With golf beginning to catch the eye of the wanabee sprortsperson, they were conveniently prompted to partake in the sport for their own good, by city doctors and ministers of the kirk. Scotland's ministers (and doctors, lawyers, bankers etc) can be found at the formation of almost every single club in the country !
So the railways and their respective companies were "massive" to the development of golf in the UK.
But damn that Caledonian Railway Co. They went and built Gleneagles at Auchterarder instead of on my back doorstep at the village of Symington near Biggar, Lanarkshire !
Hope this helps and explains a few other angles concerning the railways & golf.
Alfie