McFarland was born in Jefferson County, Tennessee, the son of Robert and Mary Ann McFarland. His grandfather, also named Robert McFarland, was a Revolutionary War veteran, and his father was a War of 1812 recruiting officer, militia colonel, and justice of the peace. While still a child, William moved with his family to Springvale Farm near Morristown in what was then northern Jefferson County, but is now part of Hamblen County. He was educated in the common schools, and attended Tusculum College near Greeneville. McFarland initially worked as a salesman for a Tazewell businessman, but returned home to manage his family's affairs following his father's death in 1844. He operated a mercantile business and tannery throughout the 1850s. During this period, he began to take an interest in railroad construction, helping to raise funds for the East Tennessee and Virginia Railroad. McFarland remained loyal to the Union during the secession crisis of 1860-1861. He attended the Knoxville session of the East Tennessee Convention in May 1861, and represented Jefferson County on the Convention's powerful business committee. During the war, he studied law under Judge Robert M. Barton, and was admitted to the bar in 1863. In 1866, he moved to Morristown to practice law.
Postwar politics and congress
During the years following the Civil War, McFarland supported President Andrew Johnson and the conservative faction of the state government. He was a delegate to the pro-Johnson National Union Convention in August 1866. In April 1869, Governor Dewitt Clinton Senter appointed McFarland judge of the state's second judicial circuit to finish out the term of James P. Swann, who had resigned. That same year, he ran for state attorney general, but was defeated by the incumbent, Thomas M. Coldwell. In subsequent years, he was active at the municipal level in Hamblen County, which had been created in 1870, and included his Springvale Farm and Morristown. In 1874, McFarland ran on the Democratic ticket against four-term Republican incumbent Roderick R. Butler for the 1st district congressional seat. While Republicans generally controlled the district, Butler was caught up in a scandal over the selling of cadetships at U.S. military academies, which may have led to low turnout that year among Republican voters. On election day, McFarland defeated Butler, 8,783 votes to 6,995. During his lone term in Congress, McFarland sought to limit federal prosecutions for illegal whiskey distilling in East Tennessee, which many of his constituents felt had gotten out of control. He also introduced legislation that would allow farmers to sell the first $100 of their annual tobacco crop tax-free, and sought appropriations for improvements to the Tennessee River and its tributaries. He favored the use of silver as legal tender. Running for reelection in 1876, McFarland was ruthlessly assailed for his affiliation with the Democratic Party, with his opponents suggesting he was conspiring with former Confederates and Southern Democrats to destroy the federal government and reopen the slave trade. He defended himself by pointing out he had remained loyal to the Union throughout the war, and had supported virtually every measure regarding pensions and other aid for former Union soldiers and their families. Nevertheless, with Republicans no longer boycotting the vote, he stood little chance of winning a second term. On election day, he was defeated by the Republican candidate, James H. Randolph, 12,349 votes to 11,215.
Later life
McFarland was again considered for the Democratic nomination for the 1st district seat in 1878, but was outpolled at the district convention that year by rising politician Robert Love Taylor. While McFarland campaigned for presidential candidates Winfield Scott Hancock in 1880 and Grover Cleveland in 1884, he mostly turned his attention to local politics. He was elected to Morristown's Board of Aldermen in 1880, and was reelected in 1881, winning more votes than any of the other fourteen candidates in this second election. In 1882, McFarland was elected mayor, defeating Major W.D. Gammon for the office after the incumbent, A.H. Gregg, declined to seek reelection. He served as mayor until 1885. McFarland died in Morristown on April 27, 1900, and was interred at City Cemetery. He was later reinterred at Emma Jarnagin Cemetery in Morristown.