The period of isolation decreed to control the spread of infectious disease.
Before the era of antibiotics, quarantine was one of the few available means for halting the spread of infectious diseases. It is still employed as may be needed.
Latin: quadraginta = forty.
This was probably because it was known that the incubation period of most infectious diseases was less than 40 days.
Venice was the first city to impose a quarantine in 1348 AD, to halt the epidemic of the bubonic plague.