What was “carnal knowledge against the order of nature"?
Anal sex a.k.a. sodomy.
The phrase is widely used in places that have a common law tradition, see also, e.g. this court ruling from Uganda (a former British colony) in 2016.
The law review article, Hon. Michael Kirby AC CMG, "THE SODOMY OFFENCE: ENGLAND’S LEAST LOVELY CRIMINAL LAW EXPORT?", Volume 1, JOURNAL OF COMMONWEALTH CRIMINAL LAW (2011), traces its history and dissemination into the British Colonies. The abstract of that article explains:
This article describes the influence of the British Empire on the
intercontinental spread of the criminal offences involving adult,
private, consensual same-sex activity. It describes the origins of
the crimes in Judeo-Christian scriptures and early English common law
and statutory offences. The nineteenth century moves for criminal law
codification in Europe succeeded in abolishing such offence. They
were not a feature of other European empires. However, although
codification of criminal law failed in England, five template codes
exported the sodomy and other offences to every land ruled by Britain.
In 41 of the 53 Commonwealth countries, the offences remain in force.
The article describes how they were (often reluctantly) repealed by
legislation between 1967-97 in the older dominions. Repeal in newer
Commonwealth countries has been slow or non-existent. The author
describes new developments that give hope for progress, including the
Naz Foundation Case in India (2009) and the recent moves in the United
Nations and elsewhere to foster legislative and judicial removal of
this unlovely legacy of Empire.”