The Canadian Pacific Railway was the price demanded by BC to join with Canada. Prime Minister Sir John A. MacDonald realized that without this railway the land west of the Great Lakes would likely become part of the US. It was also known that a line longer than any other in the world, running through the Canadian Shield, across the Prairies and traversing BC's five mountain ranges, could not pay its way unless it could create its own business. So from the start, the line was meant to be the middle link in a shipping route between Europe and the Orient, as well as a way to colonize the west.
Work on the line was supposed to have started within two years after Confederation and be completed within 10. In 1873, the project faced a set-back when it was revealed that members of the government had received money from the company responsible for construction of the railway and Macdonald's Conservatives were forced out of office. The new Liberal prime minister, Alexander Mackenzie, was not prepared to continue the railway if it meant an increase in taxation. He proposed a longer construction period and wanted to have stretches of water transporation at some stages along the route. Discontent in BC, especially in Victoria, mounted. A compromise, known as the Carnarvaon Terms, was reached. Sir John A. Macdonald returned to office in 1878 and eventually railway construction began in BC in 1880.
Large government loans were required twice to save the railway from bankruptcy. Craigellachie, where the eastward and westward construction parties met, was named for a meeting place of the Scottish clans near the birthplace of George Stephen, first president of the railway.
The famous photograph showing CPR director Donald Smith driving the last spike, with William Cornelius Van Horne, CPR general manager, standing beside him has become a Canadian icon. A careful look at the faces in the asembled crowd, however, does not reveal any Chinese, a remarkable oversight since so many Chinese were responsible for the heavy labour required to build the railway through BC.
Resources:
Last Spike on Wikipedia: http://en.wikipedia.org/wiki/Last_Spike_(Canadian_Pacific_Railway)
Pierre Berton, The Last Spike, Anchor Canada, 2001.