The third permitted category is work required for Tzorchei Rabbim, public welfare, such as repairing public roads or water pipes.
The fourth permitted category includes any work, otherwise prohibited on Chol HaMoed, that provides a worker the wages needed to cover his daily living expenses. None of the above mentioned restrictions (namely not performing the work in an artisan fashion and not deliberately postponing the work to Chol HaMoed) apply to the third and fourth categories.
The fifth permitted category involves all work required to cure the sick, including the not dangerously sick.
In order to ensure that people will honor Yom Tov by shaving and washing their clothes beforehand, the rabbis prohibit these activities on Chol HaMoed with certain exceptions. Most weddings may not be celebrated on Chol HaMoed so as not to lose the focus of the Chol HaMoed celebration. Engagements, however, are permitted.
Paradoxically, many of the Chol HaMoed restrictions, (no shaving, no washing clothes, restricted work, no tefillin, no weddings) are common to aveilut, mourning the dead. Depression is the flip side of happiness, or as the prophet Amos puts it, “I will turn your feasts into mourning.”
Indeed, Tractate Moed Katan, which sets out the laws of Chol HaMoed, also focuses on the laws of aveilut. The Talmud in Shabbat tells us that for a period of time after death the lost soul wonders back and forth between heaven and earth, trying alternately to penetrate the lifeless body and the space under God’s heavenly throne. The laws of aveilut, by focusing on the departed, accommodate this desire of the soul.
Perhaps Chol HaMoed is likewise trying to penetrate the holiness of the Festivals that surround it on either side. And the laws of Chol HaMoed, by focusing on the joy of the festival, accommodate that desire. Perhaps also the message is that in Judaism, outward appearances can be misleading and investigation of the soul is more telling.