It's all to do with the mixing.
Distemper the paint comes from the Mediaeval Latin distemperāre, which means to soak, which is in turn from dis-, apart, plus temperāre, which means to mingle.
19th-century Mongolian thanka in distemper
Distemper the disease comes from the Late Latin distemperāre, to derange the health of, from dis-, apart, plus temperāre, which means to mix in correct proportions.
Neat, isn't it? The same Latin words, borrowed at slightly different times, have given us quite different words.
I especially like the disease derivation because it shows how people thought in the past. For them health is a balance, whereas for us in the West health is nowadays usually seen as a sort of perfection.
Distemper has also meant disease, disturbance or discontent.
And so, full of wonder and perhaps even a little wiser, we go on our temperate way.
Word To Use Today: distemper. Of which you already know two derivations.