When the U.S. government decided a transcontinental railroad was necessary, it stimulated private industry to build one. Railroads, as private companies, needed to engage in profitable projects. So the federal government passed the Pacific Railroad Act that provided land grants to railroads.