As I understand it, the main role of the U.S. Surgeon General is that of a doctor who acts as a spokesperson for the federal government on public health matters.
What is the historical background as to why this person is a surgeon, and not some other type of doctor- say, one trained in internal medicine or family medicine, who might have a broader perspective on health issues and policy?
For reference, the acting U.S. Surgeon General is not a surgeon.
https://www.hhs.gov/about/leadership/vivek-murthy.html
He specializes in internal medicine, focused on vaccine research and nonprofit management during his prior career.
This doesn't answer your question, but I think it's important because you asked "why this person is a surgeon" instead of why "surgeon" is in the name of the position.
The first Surgeon General, however, was a surgeon. Woodworth was a military field surgeon and Medical Director in the Union Army.
The position was created in the wake of the Civil War to reform and add a new management structure to the Marine hospital system that had fallen into disarray during the war. Woodworth was appointed to this position after a short career in Europe as a surgeon.
The 1870 reorganization converted the loose network of locally controlled hospitals into a centrally controlled Marine Hospital Service, with its headquarters in Washington, D.C. The position of Supervising Surgeon (later Surgeon General) was created to administer the Service. Woodworth began his service in the position on March 29, 1871, and he moved quickly to reform the system. ... In this way, Woodworth created a cadre of mobile, career service physicians who could be assigned and moved as needed to the various marine hospitals.
Even in its early days, however, the position was managerial in nature, involved very little surgery, and Woodworth's early achievements focused on preventing the spread of infectious diseases (yellow fever, cholera, etc.)
Others can speak to the history of the term and how that came about. This is more of a clarification of facts. The current Surgeon General, Vivek Murthy, is not a surgeon and is trained in internal medicine. This negates the basic premise of the question. There could be a point where this changed, and it could be that at some point in history they only appointed surgeons rather than internal medicine doctors.
The 19th and 21st (current) US Surgeon General is Vivek Murthy. He is a 'hospitalist' meaning he is a general internal medicine doctor who treats all of the people being held in hospitals. Other sources describe him as an 'internist' which is someone who specializes in internal medicine.
In an article from Yale, speaking about Murthy's experience when he was first nominated, they said: "Murthy completed his residency training in internal medicine at Brigham and Women’s Hospital, where he is an attending physician. He is also an instructor at Harvard Medical School."
The Hospitalist article on him when he was confirmed starts out:
On Dec. 15, 2014, 37-year-old hospitalist and internist Vivek Murthy, MD, MBA, was sworn in as the 19th surgeon general of the United States. He is the youngest person to hold the post and the first of Indian-American descent.
Sources and further reading:
https://www.hhs.gov/surgeongeneral/about/history/index.html
https://www.britannica.com/topic/surgeon-general-of-the-United-States