There were a number of southern officers who stayed in the US Army. Most were already in the army and felt they had a duty to remain. There were a large number of southern unionists, but most were poor whites.
Major Anderson, who commanded Fort Sumpter was from Kentucky and his wife from Georgia. Jefferson Davis, Secretary of War under the Buchanan administration appointed all southern officers to command southern military installations, and most handed them over to the Confederacy. Anderson refused, because he felt he had a duty not to surrender the fort without orders to do so. The Confederates fired on it, partly starting the war. Anderson was taken on a recruiting tour of the north, and then retired from the army on grounds of ill health and left the country for France.
I have a picture frame that contains a picture of General Beauraguard, the Confederate commander at Fort Sumpter. It used the contain a picture of Major Anderson, who was a cousin, but it was removed by a Virginia relative during the war.
Anderson took a leave because of ill health after the recruiting tour and officially retired in 1863. He returned to duty as a brevet Major General in 1865 and raised the United States flag in Ft. Sumter on April 14, four years to the day after he took it down. It was only after that that he went to France, dying six years later.