After arriving in Lusk, Barrett put his law degree to good use, acting as county attorney for Niobrara from 1922 until 1934. He moved on to the Wyoming Senate until 1935, then served on the Board of Trustees of Wyoming State University. He first ran for Federal office in 1936, but lost out to Paul Greever. He stood for Congress again in 1942, and won, serving there until 1950. Among his appointments to the United States Naval Academy was future Wyoming state Senator and the 1978 Republican gubernatorial nominee John C. Ostlund (1927-2004). In 1951, Barrett was elected governor but resigned in 1953 to serve in the U.S. Senate.
On February 17, 1956, his wife Alice died of cancer. They had had four children together, one of whom had died in infancy. On April 4, 1959 he remarried, to Augusta K. Hogan. Barrett completed his term in the Senate in 1958, and lost his re-election bid. In 1959 he was appointed Chief Counsel of the Department of Agriculture His son James E. Barrett is a senior judge of the United States Court of Appeals, Tenth Circuit and former judge of the United States Foreign Intelligence Surveillance Court of Review in Washington, D.C.
Barrett was diagnosed with leukemia on May 15, 1962, and died just fifteen days later, at the age of 69. He was interred at Lusk Cemetery. Barrett was a devout Catholic, and a member of the Knights of Columbus.