In 1852, he came to Stockton but by 1853 moved to Oakland, California, where his brother-in-law resided. McKee became involved in real estate litigation arising from Mexican land grants. In 1856, Alameda County was divided from Contra Costa County, and McKee was elected a judge of Alameda County. In 1859, he became judge for the Third District Court in Oakland, California, for the counties of Alameda, Santa Clara, Santa Cruz and Monterey. In 1863, he was reelected over Judge Francis E. Spencer and won election again in 1869 and 1875. McKee held the position of District Judge until 1879, when he joined the Supreme Court. McKee tried several times to win a seat on the Supreme Court. In June 1871, McKee was put forward by the Democrats to replace Augustus Rhodes, who planned to retire in December 1871. But the party nominated Seldon S. Wright, who lost in the election. In 1873, a Supreme Court seat became open due to the death of Royal Sprague. The Democratic Party nominated McKee to run against the Republican candidate Samuel H. Dwinelle of Oakland, and Elisha W. McKinstry of the Independent Party, who was ultimately elected. In 1879, when adoption of a new constitution required elections for all seats on the Supreme Court, McKee was nominated by both the Democratic and Workingmen's parties and was finally elected. The justices drew lots to determine their length of term, and he and Milton H. Myrick both drew seven-year terms. In October 1886, McKee sought another term on the court, but lost the Democratic nomination to Byron Waters, who in turn lost the election to Van R. Paterson. After retiring from the court, McKee briefly entered into private practice in Oakland with his son, Samuel Bell McKee, Jr. McKee, Sr. contracted pneumonia on a trip to Mexico and on March 2, 1887, he died at his home in Oakland.
McKee married twice; his two wives were sisters. On January 28, 1847, he married Martha Alston Davis, a daughter of North Carolina physician Edward Davis, in Panola County, Mississippi. They had three children. After the death of his first wife, in 1859 he married her sister, Sarah Ann "Sally" Davis, and had seven more children. His children include: daughters Annie Banks McKee Mhoon, Martha, and Alma, as well as Sallie Banks McKee, plus Helen Adelaide Spence "Nellie" McKee, and Amy Marguerite McKee; and sonsJames Cain McKee, a banker, and attorneys Samuel Bell McKee, Jr., Robert Linington McKee, who practiced law in Portland, Oregon, and Edward Davis McKee, who was a clerk of the court of claims, also in Portland.