Spencer was elected, on November 5, 1918, as a Republican to the U.S. Senate to fill the vacancy caused by the death of William J. Stone; he was reelected in 1920 and served from November 6, 1918, until his death. While in the Senate, he was chairman of the Committee on Claims (Sixty-sixth and Sixty-seventh Congresses) and a member of the Committee on Indian Affairs (Sixty-seventh Congress) and the Committee on Privileges and Elections (Sixty-seventh through Sixty-ninth Congresses). He died at Walter Reed Hospital, Washington, D.C., in 1925; interment was in Bellefontaine Cemetery, St. Louis.