Originally, it was a 40-day-long period of imposed isolation, so it's from the Italian for "forty"
... a period, originally 40 days, of detention or isolation imposed upon ships, 
persons, ... Upper Italian (Venetian): period of forty days, group of forty, derivative 
of ...