He spent most of the preceding 25 years in government service. He worked as a Congressional staffer and consultant before joining the U.S. Department of Defense, where he held Army, Navy, and Air Force positions. He did not serve in the military; he was 42 years old and already Deputy Under Secretary in 2010 when the Armed Forces ended the ban on service by LGBT servicemembers who were open about their sexual orientation.
Born on July 2, 1968, and raised in Kalamazoo, Michigan, he attended Cranbrook Schools in Michigan for two years and graduated from Centerville High School in Ohio in 1986. He received his B.A. in history from Dartmouth College in 1990. His interest in government and politics began when he participated in the 1988 New Hampshire primary contest.
In the 1990s, he was on the staff of the House Armed Services Committee and later a special assistant in the Immediate Office of the Secretary of Defense. He later served as associate director of political affairs at the White House.
He also worked at Business Executives for National Security, a Washington, D.C.–based think-tank and at Robinson, Lerer & Montgomery, a strategic communications firm in New York City.
He served as deputy undersecretary and deputy chief management officer for the Department of the Navy beginning in July 2009. He was also deputy director of the Commission on the Prevention of Weapons of Mass Destruction Proliferation and Terrorism.
President Obama nominated him to be Under Secretary of the Air Force on August 1, 2012. He testified before the Senate Armed Services Committee on February 28, 2013. The U.S. Senate confirmed him on April 18, 2013. He assumed the position of Acting Secretary of the Air Force upon the resignation of Michael Donley on June 21, 2013. He served as Acting Secretary of the Air Force from June 21 to December 20, 2013, making him the second longest-tenured Acting Secretary.
In March 2015, Fanning was named "special assistant to the Secretary and Deputy Secretary of Defense (chief of staff)".
Fanning was appointed Acting Under Secretary of the Army and Chief Management Officer by President Obama on June 30, 2015. On September 18, 2015, the White House announced that President Barack Obama would nominate Fanning as United States Secretary of the Army, and the President did so on November 3, 2015. Fanning left that position on January 11, 2016, to concentrate on his confirmation, being succeeded in the temporary position by Patrick Murphy. The U.S. Senate Armed Services Committee held Fanning's nomination hearing on January 21, 2016, and approved his nomination on a voice vote on March 10, 2016, though a hold was placed on it by Senator Pat Roberts, citing comments President Obama had made about closing the Guantanamo Bay prison. Senators John McCain, chair of the Armed Services Committee, and Roberts argued about the nomination in the Senate in late April 2016. McCain said: "What we're doing here is we're telling a nominee, who is totally qualified, totally, eminently qualified for the job, that that person cannot fulfill those responsibilities and take on that very important leadership post because of an unrelated issue. That is not the appropriate use of senatorial privilege."
On May 17 Roberts told the Senate that he had received sufficient assurances from the Pentagon about Guantanamo and said: "My issue has never been with Mr. Fanning's character, his courage, or his capability. He will be a tremendous leader." The United States Senate confirmed Fanning's nomination that day on a unanimous voice vote. Fanning became the 22nd Secretary of the Army, the largest service branch of the U.S. military, and the first openly gay head of any service in the U.S. military. Following Senate approval, Fanning thanked his boyfriend Ben Masri-Cohen for his "patience at home" during the confirmation process.
With this appointment he became the highest ranking openly gay member of the Department of Defense. He was a member of the Gay & Lesbian Victory Fund from 2004 to 2007. He favors the adoption by the U.S. military of a policy prohibiting discrimination on the basis of sexual orientation. He has said: "I personally like to see these things in writing and codified." He expressed a preference for the establishment of such a policy by the Department of Defense rather than the Obama administration: "My view about government is you should always use those resources that are available to you first before you move up to the next level, so I think there are a number of things we can do inside this building for the Department of Defense". He supports allowing openly transgender persons to serve in the military as well.
In July 2016, Fanning served as the grand marshal of the gay-centered San Diego Pride parade.