Badger practiced law in North Carolina, was active in state politics, and served as a state superior court judge. A supporter of Andrew Jackson from the 1820s, he separated with him in the mid-1830s, became a leader of the Whig party and helped carry the Whigs to victory in the 1840 Presidential election.

Upon taking office, President William Henry Harrison appointed Badger as his Secretary of the Navy, and he continued in that post for a few months (until September 1841, when he resigned to resume private practice) when John Tyler succeeded to the Presidency upon Harrison's death (April 1841). Badger's brief term as Secretary was marked by efforts to strengthen the Navy in the face of tension with Great Britain, the establishment of the U.S. Home Squadron, and growing interest in steamships.