The fine folks at Merriam-Webster explain how the toilet got its name:
You may be surprised to learn that toilet and the noun toil, meaning “snare” or “trap” (as in “caught in the toils of love”), have a common ancestor: the Middle French word toile, meaning “cloth” or “hunting net.” How toil developed from the French word needs no explanation; on the other hand, how toilet as a name for a modern bathroom fixture developed from a word for “cloth” is a head-scratcher.
In Middle French, the diminutive form of toile was toilette, which means “small piece of cloth” but which also came to be used for more specific senses (many of which are reflected in the semantic development of the English word). English speakers borrowed the word in the 16th century, and eventually settled on the spelling toilet while still making use of toilette in the “grooming” sense. The word was originally used for a wrapper or covering for clothes and later for a cloth put over the shoulders while dressing the hair or shaving.
From the “shoulder cloth” sense, toilet came to refer first to a cloth covering a dressing table (or vanity) then to the articles on the table, then to the table itself. Next, a more abstract meaning developed, as the word was applied to the whole process of washing, grooming, and dressing, especially at the beginning of the day or for a special occasion. This use of the word is often found in the constructions “at one’s toilet” or “to make one’s toilet.”
She hurried at her toilet, which was soon made….
— Theodore Dreiser, Sister Carrie, 1900
Miss Chauncey proceeded to make her toilet for the night.
— Walter De la Mare, Broomsticks, 1925
During the 19th and 20th centuries, the “washing” sense of toilet was extended to the nonhuman (e.g., animals, places, tools, and such).
Before breakfast they made the toilet of the six chosen kittens.
— Edgar Jepson, Terrible Twins, 1913
The toilet of London … cannot be satisfactory unless the streets are flushed with water every night.
— The Daily Telegraph, 1855
… the workman performed ‘the toilet’ of these saws and other dreadful implements.
— The Eclectic Magazine, October 1888
The word’s “grooming” sense also developed new meaning in prisons and hospitals. It was used for the preparation of execution by guillotine, as described by Lord Ronald Gower in 1903:
The ghastly ceremony of his toilette, as they call the pinioning and cutting off the hair at the back of his head.
19th-century surgeons applied the word to the cleansing done after an operation—for example, “the toilet of the peritoneum” would be made after surgery. Toilet is still used in the medical field in this way.
At this point, our discussion of toilet has been clogged with descriptions of grooming and washing, and you’re probably wondering when we’ll get to how and when the word came to refer to the bathroom toilet we are familiar with today. We’ll plunge into that now.
In the late 18th century, toilet was transferred to the room where the grooming and washing occurred. In America, the room was most often one that included facilities for bathing, and when the water closet—which in the 1700s referred to a room with a fixture for defecation and urination capable of being flushed, or to the fixture itself—was introduced into houses that could afford one, it was typically placed in the bathroom or toilet room. In the late 19th century, toilet was transferred from the room to the fixture itself.