Middleton was born in Leith, Midlothian, Scotland, the son of Robert Middleton, a customs collector of Bo'ness, Linlithgowshire, and Helen, daughter of Charles Dundas.
During the Seven Years' War, from 1754, Middleton was stationed aboard during her apprehension and capture of two French ships at Louisbourg, after which he was stationed in the Leeward Islands. In January 1757, an incident over rum rations, during which Middleton lost his temper and physically attacked a sailor ended with the sailor being court martialled and Middleton being transferred and promoted to command of the sloop HMS Speaker.
In 1759 he was given command of the frigate HMS Arundel being promoted to post-rank for the first time. The following year, while in command of , distinguished himself in the West Indies, taking sixteen French ships and several privateers, and received the gratitude of the merchants in the British colony of Barbados. From March 1762 Middleton took command of the frigate Adventure, patrolling the coast of Normandy.
In December 1761 Middleton married Margaret Gambier, niece of Captain Mead, who he had encountered aboard HMS Sandwich some twenty years earlier. Margaret moved to Teston in Kent, to be close to her friend Elizabeth Bouverie. In 1763, after service aboard the Adventure, he moved to join Margaret at Teston, and for the next twelve years he farmed the land belonging to Mrs Bouverie, taking on the role of a country gentleman.
In 1775, at the outbreak of the American War of Independence, Middleton was given a guardship at the Nore, a Royal Navy anchorage in the Thames Estuary, and was subsequently appointed Comptroller of the Navy in 1778, a post he held for twelve years. In 1781 was created a baronet, with a special remainder, failing his male issue, to his son in law, Gerard Noel.
In 1784, Sir Charles Middleton was elected Tory Member of Parliament (MP) for Rochester, a seat he held for six years, and three years later was promoted Rear Admiral. By 1793 a Vice Admiral, he was the following year made a Lord of the Admiralty, and in 1795 became Admiral of the Blue. He was finally, in 1805, appointed First Lord of the Admiralty, and was created Baron Barham, of Barham Court and Teston in the County of Kent, with a special remainder, failing his male issue, to his only daughter Diana and her heirs male. In September 1805, Lord Barham attained the rank of Admiral of the Red. He died eight years later aged 86 at his home of Barham Court.
Ramsay's pamphlet Essay on the Treatment and Conversion of African Slaves in the British Sugar Colonies, published in 1784, especially affected Lady Middleton. Feeling inadequate to take up the issue of the slave trade in Parliament himself, and knowing that it would be a long, hard battle, Sir Charles Middleton suggested the young Member of Parliament William Wilberforce as the one who might be persuaded to take up the cause. (Whether or not this was the first time that the issue had been suggested to Wilberforce or not is debatable). In 1787 Wilberforce was introduced to James Ramsay and Thomas Clarkson at Teston, as well as meeting the growing group of supporters of abolition, which also included Edward Eliot, Hannah More, the evangelical writer and philanthropist and Beilby Porteus, Bishop of London.
Clarkson had first made public his desire to spend his life fighting for emancipation at Middleton's home, Barham Court, overlooking the River Medway at Teston, Kent. In order to make a case for abolishing the slave trade, Clarkson did much research over many years, gathering evidence by interviewing thousands of sailors who had been involved in the slave trade. This was only possible because Middleton had given Clarkson the permission needed to gain access to the Royal Navy shipyards.
Barham Court was effectively used for planning the campaign by Lord and Lady Middleton, with numerous meetings and strategy sessions attended by Wilberforce, Clarkson, Eliot and Porteus before presenting legislation to Parliament.
While Middleton never played a direct role in the effort to abolish the slave trade (accomplished 1807) and slavery itself (in 1833) by talking out about it whilst an MP, he played a very important part as a behind the scenes facilitator.
Middleton's efforts were motivated by his evangelical faith. Middleton the Christian was evident not only in these efforts, but also in his time as a captain at sea and later as Comptroller and a Lord of the Admiralty. Whilst a captain, he did everything possible to make sure that his sailors had good conditions on board and that Christian services were held on a weekly basis, even whilst in pursuit of an enemy!