Distemper is an early form of whitewash. As a decorative paint, it is easily marked and cannot get wet. It has been used since antiquity for painting walls and other types of house decoration. Because it's not waterproof, it has most often been used on interior surfaces. In regions that seldom, if ever, see rain, it can be used outside.
Distemper is less expensive than oil-based paints. Due to this, it was also used for posters and scenic backdrops on the stage. It has almost never been used for fine art paintings.
Though it saw continual use from ancient Egyptian times to the end of the 19th century, the advent of oil- and latex-based house paints have rendered distemper obsolete. The exceptions are instances of historic and period-authentic structures, where distempered surfaces continue to be maintained. It's also somewhat common in theatrical presentations and other short-term applications.